I'm giving RESTful development a shot. I'm running into some difficulty
with controller I have grouped into modules. Specifically, I have a
"admin" module with a "user" controller (created with "generate
controller admin/user"). I managed to get map.resources wired up with
this code:
I'm not sure if that's the right way, but it seems to work. The problem
I'm running into is with setting up my link_tos. I tried this code:
<%= link_to 'Show', user_path(@user) %>
Which failed with a "undefined method `user_path' for
#<#<Class:0x47eaa14>:0x47ea9ec>". Not unexpected. However I can't figure
out the right syntax for the path to my user admin actions. Can anyone
help?
Look at namespace
map.namespace :admin do |admin|
admin.resources :users
end
gives you helpers such as this:
<%= link_to 'Show', admin_user_path(@user) %>
also look at the very useful:
Hi,
Here is a perfect 2.0 RESTful nested and namespace tutorial, after
checking u would totally understand the whole stuff. I am not doing ad
here. cuz it really needs to recommend