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

  • Home
  • SEARCH
  • 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 8367973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:17:00+00:00 2026-06-09T13:17:00+00:00

I took out this snippet to explain my issue. <ul class=nav nav-pills nav-stacked red>

  • 0

I took out this snippet to explain my issue.

<ul class="nav nav-pills nav-stacked red"> 
    <li><%= link_to "Home",   'http://localhost:3000/home' %></li>
    <li><%= link_to "About",   'http://localhost:3000/about', :data => {:toggle=>"pill"} %></li>
</ul>

If I click on “Home”, the link brings me to ‘http://localhost:3000/home&#8217;. If I click on about, the pill toggles but the link does not work. This is the resulting html:

<ul class="nav nav-pills nav-stacked red">
    <li><a href="http://localhost:3000/home">Home</a></li>
    <li><a href="http://localhost:3000/about" data-toggle="pill">About</a></li>
</ul>

My goal is to be able to click a link, go to the address and have the corresponding pill highlighted.

I saw the tip about data-toggle=”pill” here: http://twitter.github.com/bootstrap/javascript.html#tabs

Thanks for the help!

  • 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-06-09T13:17:01+00:00Added an answer on June 9, 2026 at 1:17 pm

    I wound up doing a check if the current page was active

    <li class="<%= 'active' if current_page?(root_path) %>">
        <%=link_to root_path do %>
            <i class="icon-white icon-home"></i>
            Home
        <% end %>
    </li>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

thanks for all your advice I took out of this forum over the last
It took me awhile to figure out this error and was wondering why the
I took out all the things that I thought could be causing this white
I want to do something like this in Python. I took out what we
I checked out this: hg clone https://code.google.com/p/quake2-gwt-port/ and it took like 5 minutes. Is
I captured a video and took out a frame of that, converted it to
it took me some time to find out that both Eclipse and Aptana get
I took the example code from the Kendo UI demos at http://demos.kendoui.com/web/grid/remote-data.html , binding
I took a look at this answer and it goes in part to solving
We have been having this issue pop up sporadically, but now I can reproduce

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.