Hello,
I have the following rails 3 nested models:
resources :books do
resources :authors
end
I now have a view here: /books/131/authors/ And I want to each record to link to something like: /books/131/authors/3333
<% @authors.each do |author| %>
<%= link_to 'author.name', book_author_path(@book, @author) %>
<% end %>
but that error's with: No route matches {:action=>"destroy", :controller=>"authors"}
I also tried:
<%= link_to 'author.name', [@book, author] %>
Problem is the code keeps linking to /authors/3333, not /books/131/authors/3333
Ideas? thanks!