Ruby on Rails Monday, December 13, 2010

> OK, you're really close. However, think about that route. It needs
> an :incident_id and you haven't given one. For the create, you'll
> want to do incident_timesheet_path(incident)

Thank you, I realized that as well and put the (incident) parameter:
<td><%= link_to 'View Time Sheet', incident_timesheet_path(incident)
%></td>

When I click on the View Timesheet link in the Index, I get:
----
undefined method `edit_timesheet_path'
----

Which has to do with this line in timesheets/show.html.erb:
<%= link_to 'Edit', edit_timesheet_path %>

Am I referencing this edit path correctly?

As per your advice I will go ahead and read the whole Routing
documentation from front to back again because I think this will keep
coming up as I adjust the rest of the code I already had.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment