Commit c45829412ce8bbdbacd39acd8f6743a6cac58ee2

Authored by Rodrigo Souto
1 parent 1bac841f

Fixing filter selector

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/helpers/search_helper.rb
... ... @@ -103,7 +103,8 @@ module SearchHelper
103 103 klass = asset_class(asset)
104 104 if klass::SEARCH_FILTERS.count > 1
105 105 options = options_for_select(klass::SEARCH_FILTERS.map {|f| [FILTER_TRANSLATION[f], f]}, filter)
106   - onchange = "document.location.href = document.location.search.replace(/filter=[^&]*|$/,'&filter='+this.value)"
  106 + url_params = url_for(params.merge(:filter => 'FILTER'))
  107 + onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)"
107 108 select_field = select_tag(:filter, options, :onchange => onchange)
108 109 content_tag('div',
109 110 content_tag('strong', _('Filter')) + ': ' + select_field,
... ...