Conrad Taylor wrote:
> Hi, try using user_path( user ) instead of user.
I tested with user_path(user), but didn't solve the problem.
If I stack something like:
map.user ... (show)
map.user ... (update)
map.user ... (destroy)
Then the top first match should take place, which is the (show)
The reason I did that is because ... suppose I just have map.resources
users inside the routes.rb file and then I rake routes in the terminal
the result will be:
users GET /users {:action=>"index",
:controller=>"users"}
POST /users {:action=>"create",
:controller=>"users"}
new_user GET /users/new {:action=>"new",
:controller=>"users"}
edit_user GET /users/:id/edit {:action=>"edit",
:controller=>"users"}
user GET /users/:id {:action=>"show",
:controller=>"users"}
PUT /users/:id {:action=>"update",
:controller=>"users"}
DELETE /users/:id
{:action=>"destroy",:controller=>"users"}
And if you look at the last 3 paths you have user for GET, PUT and
DELETE, thats why I thought I should use just user instead of user_show,
user_update and user_delete and rails should know which one is the right
one by looking at the routes.rb and in the view. Well, appears that it
doesn't work that way, but why it does work with map.resources? I may be
missing something else?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---