1

Hi I'm trying to put Bootstrap library in my rails application, I put the script css in Stylesheets, it's working fine, and the js file in Javascript folder, I have no error in the console, I added in my application.js:

//= require bootstrap.min

after the jquery include. I tried with the bootstrap not minimized too

I tried in the application:

$(document).ready(function () {
 $("[rel=tooltip]").tooltip({
  animation: true,
  html : true,
 });
});

and in my html (haml syntax):

%a{"data-toggle" => "tooltip", :href => "#", :title => "first tooltip"} Test

But nothing works, do you have an idea?

thanks by advance for help

1 Answer 1

1

I guess you need to mark your HTML according to the javascript selector you use:

%a{:rel => "tooltip", :href => "#", :title => "first tooltip"} Test

Note the rel attribute, instead of data-toogle.

As a general rule, I'd also recommend using a broader selector: $("[rel~=tooltip]"), so you can use more than one rel value in the same element.

Hope it helps!

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for the $("[rel~=tooltip]") it was usefull

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.