thank_you
thank_you

Reputation: 11107

Routing Resources Doesn't Set up Routing Properly

Normally I would expect resources to set the routes where

/groups/:id

However, when I call rake routes I get

GET    /groups(.:format) groups#show

Also, whenever I use the view helper method groups_path(group.id) it provides the url link as

/groups.1

Finally in my routing file

resource :groups

This is the case for edit, update, and destroy actions as well. Finally, it doesn't produce an index action. I have to create that after I write the resources method. What's wrong and how do I fix this?

Upvotes: 1

Views: 38

Answers (2)

boulder
boulder

Reputation: 3266

resources :groups

instead of

resource :groups

Upvotes: 2

Zippie
Zippie

Reputation: 6088

Pluralize that resource:

resources :groups

Upvotes: 2

Related Questions