Rails 3.2敏捷Web开发中的Css
我必须使用Rails 3.2,因为我的主机。但是,我安装了Rails 3.2敏捷Web开发中的Css,css,ruby-on-rails,twitter-bootstrap,ruby-on-rails-3.2,Css,Ruby On Rails,Twitter Bootstrap,Ruby On Rails 3.2,我必须使用Rails 3.2,因为我的主机。但是,我安装了 gem "twitter-bootstrap-rails" 我还复制了《Rails的敏捷Web开发》(AgileWeb Development with Rails,第四版),Rails 3.2(实用程序员)-2011版中关于应用程序布局的css。 我把它放在这里: C:\Bitnami\chiarini\app\assets\stylesheets /* * This is a manifest file that
gem "twitter-bootstrap-rails"
我还复制了《Rails的敏捷Web开发》(AgileWeb Development with Rails,第四版),Rails 3.2(实用程序员)-2011版中关于应用程序布局的css。
我把它放在这里:
C:\Bitnami\chiarini\app\assets\stylesheets
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require fullcalendar
*= require_tree .
*/
#banner {
background: #9c9;
padding: 10px;
border-bottom: 2px solid;
font: small-caps 40px/40px "Times New Roman", serif;
color: #282;
text-align: center;
img {
float: left;
}
}
#notice {
color: #000 !important;
border: 2px solid red;
padding: 1em;
margin-bottom: 2em;
background-color: #f0f0f0;
font: bold smaller sans-serif;
}
#columns {
background: #141;
#main {
margin-left: 17em;
padding: 1em;
background: white;
}
#side {
float: left;
padding: 1em 2em;
width: 13em;
background: #141;
ul {
padding: 0;
li {
list-style: none;
a {
color: #bfb;
font-size: small;
}
}
}
}
}
我将布局的视图放在以下位置:
C:\Bitnami\chiarini\app\views\layouts\application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>aaa</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body class="<%= controller.controller_name %>">
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "aaa" %>
</div>
<div id="columns">
<div id="side">
<ul>
<li><a href="http://www....">Home</a></li>
<li><a href="http://www..../faq">Questions</a></li>
<li><a href="http://www..../news">News</a></li>
<li><a href="http://www..../contact">Contact</a></li>
</ul>
</div>
</div>
<div id="main">
<% if notice %>
<p class="alert alert-success"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert alert-danger"><%= alert %></p>
<% end %>
<%= yield %>
</div>
</body>
</html>
aaa
“全部”%>
它是这样出现的:
应该是这样的:
我不知道问题出在哪里。引导是否可能覆盖css的某些内容?如果您使用
设计gem进行身份验证和授权。请在\u筛选器:验证\u管理员之前跳过过滤前的代码>或:验证用户代码>用于根路径
如果您使用designe
gem进行身份验证和授权,还可以在app/views/designe/sessions/new.html.erb
中自定义登录(登录)模板。请在\u筛选器:验证\u管理员之前跳过过滤前的代码>或:验证用户代码>用于根路径
您还可以在app/views/designe/sessions/new.html.erb
中自定义您的登录(login)模板。安装twitter bootstrap rails gem rails后是否运行了“生成引导:安装”命令。我遵循了以下链接:我在windows上,所以我不能少安装。我使用了rails生成引导程序:安装static在安装twitter引导程序rails gem rails之后,您是否运行了“生成引导程序:安装”命令。我遵循了以下链接:我在windows上,所以我不能少安装。我使用rails生成引导:安装静态