I added bootstrap-sass to my Gemfile, did bundle install, added “@import
bootstrap” to my css file. Yet, bootstrap does;t work. Safari fails
silently, Mozila says:
The stylesheet http://localhost:3000/assets/bootstrap was not loaded
because its MIME type, “application/javascript”, is not “text/css”.
Hmm, so I changed the @import to @import bootstrap.css. Some things
seems
to work, but others (carousel, for example) don’t. Here’s one error:
TypeError: “.carousel”.carousel is not a function
Something seems to be fundamentally wrong with the install, but I’m
stumped.
I added bootstrap-sass to my Gemfile, did bundle install, added “@import
bootstrap” to my css file. Yet, bootstrap does;t work. Safari fails
silently, Mozila says:
The stylesheet http://localhost:3000/assets/bootstrap was not loaded
because its MIME type, “application/javascript”, is not “text/css”.
That’s weird, maybe you can use twitter-bootstrap-rails as show in here
In your first you have an error. You should put $ in front of
(’.carousel’).carousel(), like this: $(’.carousel’).carousel();
in jQuery “$” is an alias for “jQuery”, these two lines will do the same
thing:
$(’.carousel’).carousel();
jQuery(’.carousel’).carousel();
Usually in jQuery you will use only $. But if you have other javascript
framework included in page which has a special meaning for $, then you
should use “jQuery.” instead of “$.” to avoid conflicts with the other
framework.
Martin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.