On Nov 28, 9:07 pm, Bruno Amaral <m...@brunoamaral.eu> wrote:
> <td><%= department.courses %>
>
> that last line outputs #<Course:0x1042b8270> and it fails when i try
> to add something like department.courses.course_name
>
> I am at a loss here and haven't been able to find any clues on the
> documentation as to what I might be doing wrong. If anyone could at
> least point me in the right direction, that would be great.
Because department.courses is a collection of courses and doesn't have
a course_name attribute (although the objects in that collection will
do). You either need to pick which course you want to manipulate all
iterate over them (similarly, you can't do
@departments.department_name - you had to iterate over the departments
in that collection)
Fred
--
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