On Tue, May 24, 2011 at 9:35 AM, Niklas Nson <niklasn...@meantime.se> wrote:
> Im in love with meta_search, a great gem but i have a question: when > using it in controllers wich has the same name as the model (Photo => > PhotosController) it workes like a charm. But i have a > PeoplesController for handling accounts, profiles etc - and if i try > to use it there i get an error of: > > NoMethodError in Peoples#index > Showing /index.html.erb where line #33 raised: > undefined method `screen_name_contains' for #<ActiveRecord::Relation: > 0x10676f2a8> > I think you need to put the model name --- so something like: photo_user_screen_name Where you are telling metasearch in a similar way that you would to AR about the association to your current model, then the associated models field. > > Controller: > > def index > @search = Account.search(params[:search]) > @users = @search.where(:status => > "active").page(params[:page]).per(24) > end > > Any advice ? > > -- > 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 > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.