lundi 29 décembre 2014

Using bootstrap-sass in Rails, Bootstrap / Javascript not working


Vote count:

0




trying to learn rails (and I'm still really early on in my development) but I've hit a wall and I'm scratching my head.


I'm trying to leverage bootstrap via bootstrap-sass, and it seems like when I use the default bootstrap navigation bar I can get the bar to render - but it's not interactive. It looks like javascript isn't working properly, but I'm not sure why.


My gemfile:



source 'https://rubygems.org'

gem 'rails'
gem 'bootstrap-sass'
gem 'sprockets'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'

gem 'sdoc', '~> 0.4.0', group: :doc


group :development do
gem 'sqlite3'
gem 'spring'
end

group :production do
gem 'pg'
gem 'rails_12factor'
end


application.css



*= require_tree .
*= require_self


app/javascripts/application.js



//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .


custom.css.scss



@import "bootstrap-sprockets";
@import "bootstrap";


config/application.rb



module FamilyLunch
class Application < Rails::Application
config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
end


application.html.erb



<html>
<head>
<title>Family Lunch | <%= yield(:title) %> </title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<%= render 'layouts/header' %>
<div class='container'>
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>"><%= value %></div>
<% end %>
<%= yield %>
<%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
</div>

</body>
</html>


asked 36 secs ago







Using bootstrap-sass in Rails, Bootstrap / Javascript not working

Aucun commentaire:

Enregistrer un commentaire