Ruby on Rails Tuesday, December 14, 2010

> Instead of asking us, look at your rake routes output again! That's why
> it's there.

Thanks, I just did and realized what I had to change.

With these nested resources in place, do I still have to set @timesheet
in TimesheetsController#show?

This is what I had before:
-------------------------
def show
@timesheet = current_user.timesheets.find(params[:id])
-------------------------

The reason I'm asking is because in timehsheets/show.html.erb I have:
-------------------------
<p>
<b>Date:</b>
<%= timesheet.date %>
</p>
-------------------------
which is not working (undefined local variable or method `timesheet'). I
just want to retrieve the value for 'date' in the database timesheet
table..

--
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