Switching our routes file from Rails2 to Rails3 DSl uncovered an odd
situation, of my own making, but I am having some difficultly imagining
how to fix it.
Basically I have a commonplace: user -> user_role (clearance) <- role
type arrangement where:
User
has_many :roles, :through => :clearances
has_many :clearances
Clearance
belongs_to :role
belongs_to :user
and
Role
has_many :users, :through => :clearances
has_many :clearances
What I am trying to do is to link through new_user_role_path(@user).
But I get the following error when I try:
ActionController::RoutingError: No route matches
{:action=>"new", :controller=>"user_roles"}
The thing is that when I run rake routes I see this:
new_user_role GET /users/:user_id/role/new(.:format)
{:controller=>"user_roles",
:action=>"new"}
So, I am somewhat nonplussed as to what is going on. I probably am
misunderstanding something basic but from my point of view it seems
that the route that is shown as missing is actually there. Is there
something else I am overlooking?
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.