Priya Buvan wrote:
> @books = Book.find(:all, :joins=>"books inner join authors as a on 
> books.title=a.name", :conditions => ['name LIKE ? ', 
> '%'+params[:author][:name]+'%'])
> 
> 
> try with the above code



I put the code in Authors Controller as it is, and I get nil object 
error.
Since I am using @authors in my view, I changed the @books to @authors. 
That gives no error but it returned empty row.

The selection of 'name' takes place in view\author\index.html and the 
result of the query will be displayed in view\author\show.html
I think I have to return @authors for <% @authors.each do |geogr| %>
to work in the view, unless their is a different way to do it with 
@books

Cypray
-- 
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to