Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 - Update searches_controller search_href to use permitted params and then convert to hash because params no longer inherits from HashWithIndifferentAccess #356

Merged
2 changes: 1 addition & 1 deletion app/controllers/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def previous_href
end

def search_href(opts = { })
permitted = params.slice :page, :page_size, :section, :query, :types
permitted = permit_params.to_h.slice :page, :page_size, :section, :query, :types
query_opts = permitted.merge(opts).collect{ |k, v| "#{ k }=#{ v }" }.join '&'
"/searches?#{ query_opts }"
end
Expand Down
Loading