Thanks a lot Patrick, it works now!!!
thanks a lot.
Patrick Doyle wrote:
>> end
>>
> I don't know if this is a typo in your post or not, but your
> #show_subjects
> method sets the "@subjects" (note the plural) instance variable whereas
> your
> view references the "@subject" (note -- singul
>
> The Controller is
>
> class BookController < ApplicationController
> layout 'standard'
> def show_subjects
>@subjects = Subject.find(params[:id])
>
> end
>
> end
>
>
> The show_subjects.rhtml file is :
>
> <%= @subject.name -%>
>
> <% @subject.books.each do |c| %>
> <%= link_to c.title
2 matches
Mail list logo