figured it out by checking out rake routes. should be:
<%= link_to "+ Add Role", new_deliverable_role_path(@deliverable)
%>
On Jan 13, 9:35 am, Hardbap
<hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''ve read all the posts, blogs, peepcode about nested resources
but I
> can''t get link_to to work. I know I''m missing something
simple so I
> hope another set of eyes will help out.
>
> I have a pretty simple set up:
>
> deliverable has_many :roles
>
> role belongs_to :deliverable
>
> here is what I have in routes.rb:
> map.resources :deliverables, :has_many => :roles
>
> from views/deliverables/show.html.erb I''m trying to provide a link
to
> add a new role with this:
>
> <%= link_to "+ Add Role", new_role_url(@deliverable) %>
>
> But I get this error when rendering: undefined method
`new_role_url''
>
> I can type in the urlhttp://localhost:3000/deliverables/1/roles/new
> and it works fine so I''m stumped.
>
> Thanks in advance for the help.
>
> rails 2.0.2
> ruby 1.8.6
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---