This seems like a common task, I m sure others have come across it.
If my controller says this :
def index
s = Sunspot.search Organization do |query|
query.keywords params[:q] unless params[:q].blank?
query.with(:searchable).equal_to(params[:filter_by] == published ? true : false) if params[:filter_by]
..
How do I:
.. through a link, make it change its query.with(:searchable)
statement to query.with(:has_no_deals)
?
Here s my starter link that doesn t work, because the old query.with(:searchable)
is not overwritten:
= link_to Has No Deals , url_for(:overwrite_params => { :filter_by => dfgsdgsdf , :page => nil })