What is the best way of making these tabs persist?
http://twitter.github.com/bootstrap/javascript.html#tabs
To add some context, this is for a Ruby on Rails application. I'm passing an array [tab1, tab2] to my view, rendering both tabs and using the Bootstrap tab plugin to toggle their visibility.
Best Answer
This code selects the right tab depending on the #hash and adds the right #hash when a tab is clicked. (this uses jQuery)
In CoffeeScript:
Or in JavaScript: