activerecord-hackery / meta_search

Object-based searching (and more) for simply creating search forms. Not currently maintained.
http://erniemiller.org/2013/11/17/anyone-interested-in-activerecord-hackery/
MIT License
906 stars 140 forks source link

generation of url #85

Open fij0 opened 12 years ago

fij0 commented 12 years ago

hello, im using metasearch and i need use the metasearch form but with a pre filter that i have thanks to a params, in easy words, metasearch generate this url http://localhost:3000/libros?utf8=%E2%9C%93&search%5Bnro_iden_equals%5D=9&search%5Bnro_trans_equals%5D=&search%5B&commit=Buscar And i need generate an url like this http://localhost:3000/libros?pieza_id=9?utf8=%E2%9C%93&search%5Bnro_iden_equals%5D=9&search%5Bnro_trans_equals%5D=&search%5B&commit=Buscar

It is posible this ? Sorry about my writing , my inglish is poor

Thanks

pdabrowski6 commented 12 years ago

@fij0 how about creating hidden field which contains your filter? But don't forget to create empty scope in your model otherwise meta_search will generate error because you don't have that kind of search method definied.

It looks like this in your model:

 search_methods [...] :pieza_id

After putting this into your model and creating hidden field you should be able to use params[:search][:pieza_id] variable