pastie your models please
-----
Ryan Bigg
Freelancer
http://frozenplague.net







On 09/12/2008, at 2:14 PM, Jay Mark wrote:

>
> I am using find_by_sql because I get this error when I use  
> find_by_name
> or
> find_all_by_name
>
> "undefined method `find_by_name' for #<Class:"
>
> I get it again when I put in the code in the last post.
> Is there a way to solve the undefined method problem?
>
> Cypray
>
>
>
>
>
>
>
> Ryan Bigg wrote:
>> Stop using find_by_sql!
>>
>> You can just do:
>>
>> author = Author.find_by_name(params[:author][:name])
>> books = author.books.find(:all, :select => "title")
>
> -- 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to