Filters in Rails!

Published on: Thursday 10/12/2017

Author: Kelly-Ann
Project: Dog Informant

Two of the projects in my to-do pile include a filtering tool of some sort as their main feature. (DogInformant app will help people choose a dog breed, and the Broadway Show app will help people figure out which play to watch in New York City.)

I started with the Dog Informant app, so that when I start to put together the Broadway App for my friend, I'm better prepared to set everything up correctly.

Step 1:
Set up a "search by name" field to filter dogs by the breed name.

I found some nice helpful articles and stackoverflow answers to help with this. I set up my form as follows:

<%= form_tag(dogs_path, method: :get) do %>
  <%= text_field_tag :term %>
  <%= search_tag "Search" %>
<% end %>

Leave a reply