我遇到与此回复帖子nav-collapse not working [Twitter Bootstrap]
中所述完全相同的问题我为成为新手而道歉,但我认为这里的答案意味着我应该放置:
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
在我的application.html.erb文件的HEAD部分。
好吧,我已经完成了这个并且图标仍然没有出现。还有什么我需要做的吗?
这是我的GEMFILE来源:
source 'https://rubygems.org'
gem 'rails', '3.2.8'
gem 'bcrypt-ruby', '3.0.1'
gem "possessive"
#gem 'therubyracer', :platforms => :ruby
gem 'bootstrap-sass', '2.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'annotate', '2.5.0', group: :development
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
答案 0 :(得分:1)
确保您的文件行正确。
# app/assets/stylesheets/application.css
/*
*= require_self
*= require_tree . <-- Require all files in stylesheets directory
*/
# app/assets/stylesheets/bootstrap_and_overrides.css.less
@import "twitter/bootstrap/bootstrap";
@import "twitter/bootstrap/responsive"; <-- These two lines in the beginning of file
# app/views/layout/application.html.erb
= stylesheet_link_tag "application", media: "all" <-- Yes, it should be in head section
您是否运行$ rails g bootstrap:install
- 它应该自动为您完成所有这些工作。