Getting started with Ruby on Rails and Relationships


As a side-note, instead of doing
@results = Book.find(:all, :conditions => { :author_id =>})

You can do this:
@results = Author.find(

Or if entry is already an author instance
@results = entry.books

This also infers that your relations ships are:
has_many :books and belongs_to :author

On to your actual question, you would want to do:

<% @results.each do |result| %>
<%= h(book.title) %>
<%= h(book.description) %>
<%= h( %>
<%= h( %>
<% end %>

If this gives you problems, check that your relationships are like I said above:

has_many :books on the author model
belongs_to :author on the book model

Hope this helps.