I found a great article on sorting bootstrap tables without any gems or additional libraries. Check it out here.
I’m using Bootstrap with Rails, but I wanted to replace their alerts with growl messages. Luckily, I found this JS made by Robert McIntosh. Bootstrap-notify makes it so easy to turn your flash messages into growl messages.
- Download the JS https://github.com/mouse0270/bootstrap-notify
- Add this line to application.js: //= require bootstrap-notify.min
- Download Animate.css and put in your assets/stylesheets folder (add it to application.css, if you aren’t adding the CSS tree)
- Create a flash partial (layouts/_flash.html.erb) – change the options to customize:
<% flash.each do |type, message| %>
enter: ‘animated bounce’,
exit: ‘animated bounce’
<% end %>
6. Put this in application_helper.rb:
“success” # Green
“danger” # Red
“warning” # Yellow
“info” # Blue
7. Render the partial by adding this to “layouts/application.html.erb”:
<%= render “layouts/flash” %>
You should be all set!