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 6655287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:29:55+00:00 2026-05-26T01:29:55+00:00

What is the easiest way in rails to create a tabbed menu? I was

  • 0

What is the easiest way in rails to create a tabbed menu?

I was thinking about creating some if statements example:

<li class="<% if current.page = root_url %>currentpage<% end %>">Frontpage</li>
<ul id="submenu">
  <li><b style="text-decoration:underline">Forside 1</b></li>
  <li>Forside 45 </li>
</ul>

Here is my HTML for my menu:

<li>Frontpage</li>
<ul id="submenu">
  <li><b style="text-decoration:underline">Forside 1</b></li>
  <li>Forside 45 </li>
</ul>

<li>Frontpage 2</li>
<ul id="submenu">
  <li><b style="text-decoration:underline">Forside 1</b></li>
  <li>Forside 3 </li>
</ul>

<li>Frontpage 3</li>
<ul id="submenu">
  <li><b style="text-decoration:underline">Forside 1</b></li>
  <li>Forside 3 </li>
</ul>

I just want to style the current li element for the page. Example if a user is on Frontpage 2 the class currentpage is added to the li element for Frontpage 2 or if the user visit a subpage of Frontpage 2 it still have the class.

  • 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-26T01:29:56+00:00Added an answer on May 26, 2026 at 1:29 am

    The easiest way would be using one gem instead of building it all from the ground up.

    Take a look at this section of the ruby toolbox.

    If your question is “how do I apply style to the menu”, I suggest you create a different question, and tag it “CSS”. You will probably get a lot of good answers. I particularly like how the twitter bootstrap css lib does its navigation/tabs.

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

Sidebar

Related Questions

For some background, please see my question: Rails app using STI -- easiest way
The easiest way to explain my question may be with an example, so let
The easiest way to explain this problem is to show you some code: Public
In my Rails application there are some metrics about the content of the database
The easiest way I see to explain what I need is via example. Suppose
What is the easiest way to create a HashMap like this : ( student1
What is the easiest way to find out in Rails 3 whether a string
Rails 3.2.3 My need is populating a database using an easiest way. So I
What is the best/cleanest/easiest way to maintain the edit history of records in Rails?
I have two rails apps that I am thinking about merging into one because

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.