Skip to content

Instantly share code, notes, and snippets.

@JensRantil
Created February 6, 2013 10:50
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JensRantil/4721860 to your computer and use it in GitHub Desktop.
Save JensRantil/4721860 to your computer and use it in GitHub Desktop.
Code that makes it possible to link directly to a nested (Bootstrap) tab. Also, see http://stackoverflow.com/questions/7862233/twitter-bootstrap-tabs-go-to-specific-tab-on-page-reload
@thefonso
Copy link

Hmm, so let me ask you, how would I get this working inside my rails app. Say I save this JS file in my app/assets/javascripts directory. Would I then be able to simply type "http://localhost:3000/profiles/4/edit#tab_two"
and land on the requested page with the tab_two appearing?

@JensRantil
Copy link
Author

@thefonso I just stumbled across your comment. Seems I did not get a notification for this.

I don't know Ruby on Rails, but if putting my file in the asset folder automatically adds a <script ...> tag, it should work.

@angelo2231
Copy link

I just want to ask regarding what if the links is from other page then it will trigger the specific tab with tab content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment