Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:17:23+00:00 2026-05-23T00:17:23+00:00

I’d like to create some tabbed views for displaying content in a Rails 3

  • 0

I’d like to create some tabbed views for displaying content in a Rails 3 app I’m working on. Since I’m relatively new, I figured I’d try to use tools/resources that are core to Rails 3/3.1. With Sass and Coffe Script being adopted in 3.1, I figured I’d start with those two.

Can anyone direct me to some examples or tutorials, or layout the basic workflow for using either of these options?

I’ve done some searching, but the closest I come is some JQuery examples and none for Sass. Since Sass is more or less an abstraction of CSS, should I just work backwards from some of the CSS examples out there?

I realize this is an open-ended request, but there’s so many options, styles and opinions in open-source. So, I try to narrow things down to best-practices when I can…

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:17:24+00:00Added an answer on May 23, 2026 at 12:17 am

    jQuery UI is good, as is jQuery Tools.

    It’s also not very hard to home-grow your own solution (with jQuery). Basically, you just want to show a different div each time a different li is clicked. Let’s say that each li has an id that’s just the div‘s plus -tab, e.g. there’s an #about div and a #about-tab list item. Here’s how the basic logic might work:

    # Handle tab clicks
    $('ul.tabs li').click ->
      $tab = $(this)
      oldDivId = $tab.siblings(':selected').removeClass().attr('id')[0...-4]
      if oldDivId then $("##{oldDivId}").hide()
      newDivId = $tab.attr('id')[0...-4]
      $("##{newDivId}").show()
      $tab.addClass 'selected'
    
    # Initially select the first tab in each tab list by simulating clicks
    $('ul.tabs').each ->
      $(this).children().first().click()
    

    Styling-wise, start with list-style: none on ul.tab and display: inline-block on the ul.tab li, give ul.tab li.selected a different background color, then tweak from there.

    Of course, using an existing plugin is less work and gives you more advanced features and some nice chrome, but doing it yourself gives you a better understanding, more efficient JS, and lets you style everything in ways that might better fit your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
We're building an app, our first using Rails 3, and we're having to build
I've got a string that has curly quotes in it. I'd like to replace
I have text I am displaying in SIlverlight that is coming from a CMS
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.