Reputation: 1080
@shift_requirement belongs_to @reckoner - and in my routes
resources :reckoners do
resources :shift_requirements
end
In /reckoners/show.html.erb I have
<%= link_to 'Add a shift', [:new, @reckoner, @shift_requirement] %>
... but I'm getting a new @reckoner rather than the new @shift_requirement that I want - where am I going wrong?
Upvotes: 0
Views: 36
Reputation: 51161
You should have:
<%= link_to 'Add a shift', [:new, @reckoner, :shift_requirement] %>
Upvotes: 1