> On Mon, Aug 9, 2010 at 9:28 AM, doabit <
doins...@gmail.com> wrote:
> > i use inherited_resources and mongoid in my porject,but iwhen use
> > inherited_resources link that :
> > class PostsController < InheritedResources::Base
> > belongs_to :user,:finder => :find_by_name, :param => :user_name
> > en
>
> > show errors :undefined method `find_by_name'
>
> > does anybody know ,how to path this ?thank you @@
>
> In your User model add the method
>
> def self.find_by_name(name)
> where(:name => name).first
> end
>
> --