On 14 December 2010 18:44, Finne Jager <li...@ruby-forum.com> wrote:
>> No, I'm sure it's working fine.  But you're defining @timesheet in your
>> controller, then calling timesheet (without the @) in the view.
>
> Got it, I changed it back to @timesheet.
>
>>> Does it even need to find by ID if I'm
>>> already using the incident_timesheet_path(incident) link?
>>
>> Yes.  That only passes the ID.  HTTP has no means of passing
>> ActiveRecord objects around.
>
> Ok, thanks for the development log tip! I wasn't aware of it.
> I now use the incident_id to set @timesheet like this:
> @timesheet = Incident.find(params[:incident_id]).timesheet
>
> And it looks like it's working!

Great.  Do have a go with ruby-debug too.  You should not need it
often but sometimes when you just cannot understand what is going on
then it is invaluable.

Colin

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

Reply via email to