# Creating incorrect plurals when generating scaffold

**URL:** <https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741>\
**Category:** Rails\
**Created:** [February 21, 2008, 7:38am UTC](https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741 "2008-02-21T07:38:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ocelotspot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecccb3/32.png) [@ocelotspot](https://www.ruby-forum.com/u/ocelotspot)\
**Post date:** [February 21, 2008, 7:38am UTC](https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741/1 "2008-02-21T07:38:09Z")

</div>

Preface: I’m trying to find my way through the “Build Your Own Ruby on  
Rails Web Application” book. I’m completely new to programming and am  
having a hard time figuring out the differences between rails 2.0.2 and  
what’s in the book so please forgive me if this is a stupid question.

I’m confused because I finally thought I’d figured out the whole  
scaffolding thing but when I try to generate a scaffold for “Story”, it  
creates EVERYTHING as “stories”. I even have to go to  
[http://localhost:3000/stories](http://localhost:3000/stories) instead of [http://localhost:3000/story](http://localhost:3000/story) to  
see the scaffold. When I generate a scaffold for “stories” it makes the  
exact same thing. Am I missing something?

I’m running this in Terminal a Mac OS 10.5.2 (Leopard) with MySQL, Rails  
2.0.2 and Ruby 1.8.6, and WeBRICK

Here’s the code, the only commands I did before this is  
$rails -d mysql shovell  
$cd shovell

admins-macbook:shovell Admin$ script/generate scaffold Story name:string  
link:string  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/stories  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
create app/views/stories/index.html.erb  
create app/views/stories/show.html.erb  
create app/views/stories/new.html.erb  
create app/views/stories/edit.html.erb  
create app/views/layouts/stories.html.erb  
create public/stylesheets/scaffold.css  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/story.rb  
create test/unit/story\_test.rb  
create test/fixtures/stories.yml  
create db/migrate  
create db/migrate/001\_create\_stories.rb  
create app/controllers/stories\_controller.rb  
create test/functional/stories\_controller\_test.rb  
create app/helpers/stories\_helper.rb  
route map.resources :stories

Then I just run  
$rake db:migrate

and everything works fine at [http://localhost:3000/stories](http://localhost:3000/stories)

---

<div class="post-metadata">

**Author:** ![ocelotspot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ecccb3/32.png) [@ocelotspot](https://www.ruby-forum.com/u/ocelotspot)\
**Post date:** [February 21, 2008, 7:44am UTC](https://www.ruby-forum.com/t/creating-incorrect-plurals-when-generating-scaffold/129741/2 "2008-02-21T07:44:04Z")

</div>

On Feb 20, 2008, at 10:38 PM, Kelly T. wrote:

> I’m confused because I finally thought I’d figured out the whole  
> scaffolding thing but when I try to generate a scaffold for “Story”,  
> it  
> creates EVERYTHING as “stories”. I even have to go to  
> [http://localhost:3000/stories](http://localhost:3000/stories) instead of [http://localhost:3000/story](http://localhost:3000/story)  
> to  
> see the scaffold. When I generate a scaffold for “stories” it makes  
> the  
> exact same thing. Am I missing something?

You’re doing the right thing. Controllers are plural, models are  
singular. You’ll have to do the translation between what’s printed in  
the book and how Rails’ scaffold works.

By observing these pluralization rules, routing becomes far easier, so  
unless you’re keen to swim upstream don’t try to force controllers  
into singular form.
