TableSort JQuery not working with dynamic Rails Table

Dear All,

I am trying to use Table sort Jquery plugin to sort my table in Rails application by clicking Table header. But it is not working.I added

<%= javascript_include_tag ‘jquery.js’%>

<%= javascript_include_tag ‘jquery.tablesorter.js’%> in my layout…

Here is my Code,

Listing books


<% @books.each do |book| %>


<% end %>



<%=h book.title %>

<%=h %>

<%= link_to ‘New book’, new_book_path %>

Help me pals…

Move outside loop, and then check.