I am filling the Twitter bootstrap accordion with data from my Rails application, and I am looking to be able to filter the data. I found some nice jQuery plugins, but none of them filter data. Is it because it is not a simple list? Edit: no longer use the list. This is the code that I still have:
<div id="descriptions"> <% unless @subcategories.nil? %> <form class="filterform" action="#"> <input class="filterinput" type="text"> </form> <div id="list" class="display-subcategory"> <div class="accordion" id="accordion2"> <% @subcategories.each do |s| %> <% unless s.description == "No description yet"%> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle purple-text" data-toggle="collapse" data-parent="#accordion2" href="#collapse<%=s.name.gsub(/\s+/, "")%>"> <h3><%= s.name %> </h3> </a> </div> <div id="collapse<%=s.name.gsub(/\s+/, "")%>" class="accordion-body collapse out"> <div class="accordion-inner"> <%= s.description.html_safe %> </div> </div> </div> <% end %> <% end %> </div> </div> <% end %> </div>
And this is the plugin I use: http://anthonybush.com/projects/jquery_fast_live_filter/
Edit: I will no longer use this plugin, and I will try to write my own filter function.
I am trying to filter by the name of the elements, but I canβt figure it out and would appreciate some help. Thanks.
source share