What are good ways to build dynamic tabs in rails?
I am trying to build a page with dynamic tabs where if a user clicks on one tab, they are shown the content of that tab. Once they click another tab, the content of the new tab is displayed without refreshing the page.
I know there are a few options out there to use, mainly:
JQuery UI Tabulous TabsOnRails
I am not sure which one people have used开发者_如何学JAVA and which one is "better" both in terms of ease of use/understanding as well as performance. Let me know what you guys think.
Also, since JQuery UI has a lot of other functions like draggable, etc. Is there a way I can install just the tabs portion of JQuery UI using homebrew?
Thanks a lot in advance.
EDIT
Let me clarify, this is for a product site so the tabs are the description and reviews for each individual product. Each product page will have those tabs and the content of each of the tabs changes with different products.
- If the content is not a lot, then just show all of them as the page loads, and use jQuery to do the magic.
- If the content is a lot, using Ajax or render a new page (with similar tab but different highlited tab) can be useful. I recommend rendering a new page for SEO sake.
- I don't know why homebrew comes into picture in this. You can simply follow the examples in jQuery UI, and learn from it. Draggable is something difficult to learn though.
EDIT
Upon asker updates, I would suggest running it as a separate render. For example, in the product URL: http://abc.com/products/1234, then for the tab for reviews: http://abc.com/products/1234/reviews. Just make a new controller for reviews
will do.
精彩评论