Hi,
I am going through a tutorial in a rails book. I have Something off with
routes:
I have RESTful resource in routes.rb:
“…
map.resources :users, :member => { :enable => :put } do |users|
users.resources :roles
end
…”
and in a html.erb partial I have:
“…
<%= link_to ‘assign role’,
role_url(:id => role.id, :user_id => @user.id),
:method => :put %>
…”
I get:
NoMethodError in Roles#index
Showing roles/_role.html.erb where line #9 raised:
undefined method `role_url’ for #ActionView::Base:0x3637bdc
I might be using newer version of rails than the book. The role_url is
not an explicitly defined route in this tutorial routes.rb file, I don’t
know enough about RoR, but I am guessing the role_url should be
automatically available, so I would appreciate any help with this
because my RoR learning is halted here.
Cheers,
Mark