I'm having an issue with my routes and the name of the path it generates. Or I'm naming it wrong in the view or something... not totally sure. My relationships in my models are as follows:
class Client < ActiveRecord::Base
has_many :users
has_many :elements, :through => :users
end
class Element < ActiveRecord::Base
belongs_to :user
end
My routes are like:
map.resources :elements
map.resources :clients, :has_many => :elements
And in my view I have:
<%= link_to element.name, client_element_url %>
But the error I get is:
edit_client_element_url failed to generate from {:action=>"edit", :controller=>"elements"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["clients", :client_id, "elements", :id, "edit"] - are they all satisfied?
I'm not sure how to proceed, am I missing something that is right in my face?