# TableSort JQuery not working with dynamic Rails Table

**URL:** <https://www.ruby-forum.com/t/tablesort-jquery-not-working-with-dynamic-rails-table/175357>\
**Category:** Rails\
**Created:** [September 11, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/tablesort-jquery-not-working-with-dynamic-rails-table/175357 "2009-09-11T19:35:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghav\_endiran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea5d25/32.png) [@Raghav\_endiran](https://www.ruby-forum.com/u/Raghav_endiran)\
**Post date:** [September 11, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/tablesort-jquery-not-working-with-dynamic-rails-table/175357/1 "2009-09-11T19:35:13Z")

</div>

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 %\>

| Title | Author |
| --- | --- |
| \<%=h book.title %\> | \<%=h book.author %\> |

  
\<%= link\_to 'New book', new\_book\_path %\>

Help me pals…

–  
Regards,  
Raghavendiran J M

---

<div class="post-metadata">

**Author:** ![Raghav\_endiran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea5d25/32.png) [@Raghav\_endiran](https://www.ruby-forum.com/u/Raghav_endiran)\
**Post date:** [September 11, 2009, 8:46pm UTC](https://www.ruby-forum.com/t/tablesort-jquery-not-working-with-dynamic-rails-table/175357/2 "2009-09-11T20:46:38Z")

</div>

## Move outside loop, and then check.

à¤…à¤­à¤¿à¤¨à¤µ  
[http://twitter.com/abhinav](http://twitter.com/abhinav)
