Hello,
I would like to use the plugin act_as_ferret for a multiple search in
different model, I’ve found some examples on web but only for one model.
Does someone know a nice tutorial for search in multiple models?
Thanks in advance,
Hello,
I would like to use the plugin act_as_ferret for a multiple search in
different model, I’ve found some examples on web but only for one model.
Does someone know a nice tutorial for search in multiple models?
Thanks in advance,
Hi, I don’t know of any, but here’s a quick example of what to put in
your controller to get you started (you can also hack through the plugin
code to work out how it does it):
#we want a paginated list of results for the view:
@results = ActsAsFerret::find(params[:query],
[Model1, Model2, Model3, Model4],
#options
{:page => params[:page], :per_page => 10},
#active record options (can be empty)
{:conditions => {:model_1 => “model 1 conditions”,
:model_2 => “model 2 conditions”
}
}
)
san 1981 wrote:
Hello,
I would like to use the plugin act_as_ferret for a multiple search in
different model, I’ve found some examples on web but only for one model.
Does someone know a nice tutorial for search in multiple models?Thanks in advance,
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs