I’d like to use twitter bootstrap manually, on my rails project.
But I’ve got this error, and some functions of bootstrap don’t work.
If you help me, I appreciate it. Thank you.
Errors on Console
Uncaught TypeError: Cannot read property ‘Constructor’ of undefined bootstrap-popover.js:38
(anonymous function) bootstrap-popover.js:38
(anonymous function) bootstrap-popover.js:115
app/view/app/index.html.erb
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<%= stylesheet_link_tag "bootstrap" %>
<%= stylesheet_link_tag "bootstrap-responsive" %>
<%= javascript_include_tag "jquery" %>
<%= javascript_include_tag "bootstrap" %>
<%= javascript_include_tag "bootstrap-transition" %>
<%= javascript_include_tag "bootstrap-alert" %>
<%= javascript_include_tag "bootstrap-modal" %>
<%= javascript_include_tag "bootstrap-dropdown" %>
<%= javascript_include_tag "bootstrap-scrollspy" %>
<%= javascript_include_tag "bootstrap-tab" %>
<%= javascript_include_tag "bootstrap-tooltip" %>
<%= javascript_include_tag "bootstrap-popover" %>
<%= javascript_include_tag "bootstrap-button" %>
<%= javascript_include_tag "bootstrap-collapse" %>
<%= javascript_include_tag "bootstrap-carousel" %>
<%= javascript_include_tag "bootstrap-typeahead" %>
<!-- as example, which doesn't work, somehow -->
<i class="icon-search icon-home"></i>
I believe everything necessary js and css files are in
- ./app/assets/images
- ./app/assets/javascripts
- ./app/assets/stylesheets
If you would like to add asset files ( like
.js,.cssor images ) in Rails >3 , you should use manifest files : application.js , application.css . After you copy sources in their directories , you should make declarations like this :and in application.css:
It makes useless including `<%= javascript_include_tag %> in your views .