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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:43:59+00:00 2026-06-19T01:43:59+00:00

I’m developing a Ruby on Rails app that is using both Twitter Bootstrap and

  • 0

I’m developing a Ruby on Rails app that is using both Twitter Bootstrap and jQuery UI. As far as my knowledge goes, most (maybe all?) incompatibility issues between the two have been worked out (and I have the latest gems of both installed and included in asset pipeline). This question doesn’t really have much to do with jQuery UI, I just thought it may be a good bit of knowledge in case there is a compatibility issue there I am unaware of…

Anyway – I’m simply trying to include a few vertically-stacked radio buttons on a user’s page and for some reason the radio button’s are acting just like regular buttons. At first I attributed this to a likely typo like data-toggle="buttons-raadio" or something silly like that, but upon inspection I didn’t see any difference in my code and the suggested format in the documentation. Eventually I got frustrated and just copy-pasted the code (both the HTML and the Javascript to enable the buttons) directly from the documentation for a litmus test, and I got the same behavior.

So, the if you didn’t click the link, the documentation gives a simple example as follows:

    <!-- HTML -->
    <div class="btn-group" data-toggle="buttons-radio">
      <button type="button" class="btn btn-primary">Left</button>
      <button type="button" class="btn btn-primary">Middle</button>
      <button type="button" class="btn btn-primary">Right</button>
    </div>

    /Javascript
    <script> 
      $('.nav-tabs').button();
    </script>

So, what’s the deal? Why is the “active” class not being added to the radio-buttons on a click? I do find it interesting that it says to use it on the class .nav-tabs, instead of .btn (which I tried to no avail, it just messes up the pretty formatting of btn-primary while still not giving the correct functionality), but I’m guessing .nav-tabs filters down to buttons somewhere along the line.

Also, so I decided to check the html on the documentation, and sure enough I’ve got the exact same HTML coupled with the same JavaScript call… I’m at a loss.

Thanks in advance for any and all answers.

-MM

  • 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-19T01:44:01+00:00Added an answer on June 19, 2026 at 1:44 am

    I’ve done some more research, and this seems to be an issue with compatability between twitter bootstrap and jquery-ui, the specific gems for both as following:

    • gem ‘bootstrap-sass’, ‘2.1’
    • gem “jquery-ui-rails”, “~> 4.0.0”

    So I didn’t actually use the bootstrap/jquery-ui bundled gems out there, which could be part of my issue. On a button click, I would receive a Javascript error:

       Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'toggle' (jquery.js: 552)
       Full trace:
        Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'toggle' jquery.js:552
        jQuery.extend.error jquery.js:552
        (anonymous function) jquery.ui.widget.js:183
        jQuery.extend.each jquery.js:661
        jQuery.fn.jQuery.each jquery.js:272
        $.fn.(anonymous function) jquery.ui.widget.js:179
        (anonymous function) bootstrap-button.js:93
        jQuery.event.dispatch jquery.js:3333
        elemData.handle.eventHandle jquery.js:2942
    

    And if I instantiated each button with the .button() method, I would then received a different error:

        Uncaught Error: no such method 'toggle' for button widget instance (jquery.js:552)
        Full error trace:
         Uncaught Error: no such method 'toggle' for button widget instance jquery.js:552
         jQuery.extend.error jquery.js:552
         (anonymous function) jquery.ui.widget.js:187
         jQuery.extend.each jquery.js:661
         jQuery.fn.jQuery.each jquery.js:272
         $.fn.(anonymous function) jquery.ui.widget.js:179
         (anonymous function) bootstrap-button.js:93
         jQuery.event.dispatch jquery.js:3333
         elemData.handle.eventHandle jquery.js:2942
    

    To work around this, I’ve added a my-button class to each button, and am doing the click handling myself (keep in mind, you must make sure to add and remove the active class based on which button was clicked, which I am doing through the addClass() and removeClass() methods).

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

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.