Answer the question
In order to leave comments, you need to log in
Why doesn't the button always work in Rails?
Hello, I did a basic search, but I can't figure out why the search button doesn't always work.
<%= form_tag users_path, :method => 'get' do %>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag "Search" %>
<% end %>
def index
@users = User.where(["name LIKE ?","%#{params[:search]}%"])
end
Answer the question
In order to leave comments, you need to log in
Read up on what Turbolinks are, turn them off, or use the jquery-turbolinks gem (but better off).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question