Issues using Table Sorter with Ruby on Rails

Issues using Table Sorter with Ruby on Rails

Hello, I have a huge issue with the table sorter plugin currently. For some reason, even though everything shows up fine, when I click on a header nothing is sorting itself out. I have seen other people successfully use table sorter with ruby on rails but I am having  a strong issue with it.

Here is my index.html.erb
  1. <head>
  2. <script>
  3. $(document).ready(function()
  4. {
  5. $("#items").tablesorter();
  6. }
  7. );
  8. </script>
  9. </head>

  10. <body>

  11. <h1>All Items</h1>

  12. <table id="items" class="tablesorter tablesorter-blue">
  13. <thead>
  14. <tr>
  15. <td class="header">Item Name</td>
  16. <td class="header">Category</td>
  17. <td class="header">Item Description</td>
  18. <td class="header">Cost to Acquire</td>
  19. <td class="header">Auction Bought At</td>
  20. <td class="header">Auction Date</td>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. <% @items.each do |item| %>
  25. <tr>
  26. <td><%= item.itemName %></td>
  27. <td><%= item.category %></td>
  28. <td><%= item.itemDesc %></td>
  29. <td><%= item.costToAcquire %></td>
  30. <td><%= item.auctionBoughtAt %></td>
  31. <td><%= item.auctionDate %></td>
  32. <td><%= link_to "Delete",item_path(item), method: :delete,data: { confirm: 'Are you sure?' } %></td>
  33. <td><%= link_to "Edit", edit_item_path(item) %></td>
  34. </tr>
  35. <% end %>
  36. </tbody>
  37. </table>

  38. <%= link_to "Add an Item", new_item_path, class: "new_item" %>
  39. </body>

Here is my Gemfile

  1. source 'https://rubygems.org'

  2. gem 'jquery-tablesorter'
  3. gem 'jquery-turbolinks'

  4. # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  5. gem 'rails', '4.0.4'

  6. # Use sqlite3 as the database for Active Record
  7. gem 'sqlite3'

  8. # Use SCSS for stylesheets
  9. gem 'sass-rails', '~> 4.0.2'

  10. # Use Uglifier as compressor for JavaScript assets
  11. gem 'uglifier', '>= 1.3.0'

  12. # Use CoffeeScript for .js.coffee assets and views
  13. gem 'coffee-rails', '~> 4.0.0'

  14. # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  15. # gem 'therubyracer', platforms: :ruby

  16. # Use jquery as the JavaScript library
  17. gem 'jquery-rails'

  18. # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
  19. gem 'turbolinks'

  20. # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  21. gem 'jbuilder', '~> 1.2'

  22. group :doc do
  23.   # bundle exec rake doc:rails generates the API under doc/api.
  24.   gem 'sdoc', require: false
  25. end

  26. # Use ActiveModel has_secure_password
  27. # gem 'bcrypt', '~> 3.1.7'

  28. # Use unicorn as the app server
  29. # gem 'unicorn'

  30. # Use Capistrano for deployment
  31. # gem 'capistrano', group: :development

  32. # Use debugger
  33. # gem 'debugger', group: [:development, :test]
And here is my application.html.erb

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <title>Debsmiscriver</title>
  5.   <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
  6.   <%= javascript_include_tag params[:controller], "data-turbolinks-track" => true %>
  7.   <%= csrf_meta_tags %>
  8. </head>
  9. <body>

  10. <%= yield %>

  11. </body>
  12. </html>

Any help would be seriously appreciated!