0

我遇到了与此已回答帖子中所述完全相同的问题-导航折叠不起作用[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'
4

1 回答 1

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- 它应该自动为你完成所有这些工作。

于 2012-09-12T22:50:53.460 回答