dimanche 31 janvier 2016

Filtering by checkbox in rails

I have suffering one issue in my rails application search by checkbox.

This is my checkbox code:

<form action="<%= search_path %>" method="get">
  <%= check_box_tag :title, params[:title] %> Title
  <input type="submit" value="Fielter" />
</form>

This code searching but showing default =on in url like this:

http://localhost:3000/search?title=on

How can I search title like ABC & remove default =on.

I need like this :

http://localhost:3000/search?title=ABC

Thanks




Aucun commentaire:

Enregistrer un commentaire