I'm using it like this:
`<%= form_for_filterrific @filterrific do |f| %>
<%= f.add_filter('Dial', include_blank: '- Any -') %>
<%= f.add_filter('Color', id: '123', include_blank: '- Any -') %>
<% end %>`
Here is my scope:
scope :with_any_product_option_values, proc { |option_value| includes(:options) .where(product_options: { value: option_value }) }
And here is my controller action:
`def index
@filterrific = initialize_filterrific(
Product,
params[:filterrific],
select_options: {
sorted_by: Product.options_for_sorted_by,
with_name: Product.options_for_select,
with_any_option_names: Product.options_for_select,
with_any_product_option_values: Product.options_for_select
}
) or return
@products = @filterrific.find.page(params[:page])
respond_to do |format|
format.html
format.js
end
end`
But if I go this way, I got the same parameters in url, like:
'utf-8&filterrific[with_any_product_option_values]=Colored&filterrific[with_any_product_option_values]=Green'
And filterrific doesn't work because of this.. Is there any way to make custom name parameters in url for filterring?
Hello, I've created Form helper that helps me to add filters on page `class ActionView::Helpers::FormBuilder
end`
I'm using it like this: `<%= form_for_filterrific @filterrific do |f| %>
<% end %>`
Here is my scope:
scope :with_any_product_option_values, proc { |option_value| includes(:options) .where(product_options: { value: option_value }) }
And here is my controller action: `def index @filterrific = initialize_filterrific( Product, params[:filterrific], select_options: { sorted_by: Product.options_for_sorted_by, with_name: Product.options_for_select, with_any_option_names: Product.options_for_select, with_any_product_option_values: Product.options_for_select } ) or return @products = @filterrific.find.page(params[:page])
end`
But if I go this way, I got the same parameters in url, like: 'utf-8&filterrific[with_any_product_option_values]=Colored&filterrific[with_any_product_option_values]=Green'
And filterrific doesn't work because of this.. Is there any way to make custom name parameters in url for filterring?