If your form method is "GET", the page is always available when you hit back button and the query strings are all in url. In many cases this effect is preferred, for example you can bookmark a Google search url.
You can change form method as "POST" so the page will not be available again.
Add
Use this with a bit caution. In convention "GET" is meant to get data and "POST" is meant to add some data. A search form is built for get data so the convention of form method is "GET", nothing wrong here. So only change it if you really need to that.
Add more OP said he can't change form method
Well, here is a hack, if you want search result to appear to only on click of button, instead of url with params.
The idea is to use Javascript to attach a new hidden input when clicking button, then controller verify if this new param exists. If exists, process and return result, else show some error.
# JavaScript
$('#the_form button').on('submit', function() {
this.preventDefault();
this.parent.append('<input type="hidden" name="human_hit" value="yes" />');
this.parent.submit();
})
# Controller
def search
if params[:human_hit]
# Do search logic and deliver
else
redirect_to :back, alert: "You need to hit the button to search"
end
end
This is a hack and not verified, the idea should be able to do the trick.