This is my memo on Adding Ajax to forms in Rails.
Adding Ajax to web forms is a common practice so Rails makes Ajax easy to implement.
Add remote: true option to form_for method then Rails automagically uses Ajax.
method: :get, remote: true, class: "btn btn-xs btn-info"
Use respond_to method to handle both html and js formats.
Replace the content by rendering a partial.
When a filter button is clicked, the following script is invoked via household_items#index action.
It replaces the table content with filtered data.