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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:37:14+00:00 2026-06-08T17:37:14+00:00

I have this nav menu with 2 tabs: <div id=user_menu> <ul class=nav nav-tabs> <li

  • 0

I have this nav menu with 2 tabs:

<div id="user_menu">
 <ul class="nav nav-tabs">
  <li class="active"><%= link_to "Group1", group1_friends_path(@user), :remote => true %></li>
  <li><%= link_to "Group2", group2_friends_path(@user), :remote => true %></li>
 </ul>
</div>

I’ve managed to let Ajax render certain partials. Now, when I click on the tabs the partials load in my target placeholder div. I buid this jquery script to handle this,

tab.js: which I placed in assest/javascripts/

$('#user_menu a').click(function (e) {
    $('ul.nav-tabs li.active').removeClass('active')
    $(this).parent('li').addClass('active')
})

My application.js looks like this:

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .

Any help would be appreciated.

  • 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-08T17:37:16+00:00Added an answer on June 8, 2026 at 5:37 pm

    Try this. Maybe it’s beeing executed before the document is ready?

    $(function() {
      $('#user_menu a').click(function (e) {
        $('ul.nav-tabs li.active').removeClass('active')
        $(this).parent('li').addClass('active')
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a menu set up this way: <div id='top-navigation'> <ul> <li><a class='top-nav-button-unclicked' href='#'>SUBJECT</a></li>
I have this structure <nav> <ul id=nav class=sf-menu sf-navbar sf-js-enabled sf-shadow> <li id=level1-home class=current
I have this code for my top.phtml file <div class=header-nav-container> <div class=header-nav> <h4 class=no-display><?php
I have this menu: <ul id=nav> <li class=level0>Item 1</li> <li class=level0 parent> <a><span>Click Me!</span></a>
I have this navigation menu: <nav id=hoofd_menu> <a href=portfolio/ title=Portfolio target=_self class=fade portfolio>Portfolio</a> <a
I have this code: <header> <div id=title> <img alt=logo src=/Content/logo.gif /> </div> <nav> <ul
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
I have a basic website nav layout that looks like this: <li class=folder parent_folder>
I have this horizontal menu. The menu looks like tabs and are 29px high.
I have this HTML <ul class=nav> <li>Link 1</li> <li>Link 2</li> <li>Link 3</li> </ul> <ul

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.