2

Here is my code in my index.html.erb view:

<script charset="utf-8">
  $(".fa-filter").on("click", function() {
    $("#visible-filters").animate({width: "toggle"}, 1000);
  });
</script>

<div class="container">
  <i class="fa fa-filter fa-4x"></i>
  <%= render partial: "shared/trip_filters" %>
</div>

My filter is this:

<div id= "visible-filters" class="trip-filters">
  <p> Trip Categories </p>
  <% @categories.each do |category| %>
    <% if params[:category] == category.name.parameterize %>
      <%= check_box :category, category.name.parameterize, {checked: true} %> <%= category.name %><br/>
    <% else %>
      <%= check_box :category, category.name.parameterize %> <%= category.name %><br/>
    <% end %>
  <% end %>
  <br/>
</div>

Currently when I click on the filter font-awesome icon, nothing happens. What can I do? What am I missing?

Jwan622
  • 11,015
  • 21
  • 88
  • 181
  • Possible duplicate of [Binding events on font awesome icons](http://stackoverflow.com/questions/12355180/binding-events-on-font-awesome-icons) – raphael Nov 28 '15 at 21:30
  • Also have a look at [this answer](http://stackoverflow.com/a/28211254/4047679) – raphael Nov 28 '15 at 21:51

0 Answers0