This chapter targets: Detail view, rails routing, Asset Pipeline, Sass
1. Bootstrap is an open source web design framework developed by Twitter
Mockup is a Web concept diagram, often referred to as a "wireframe" in the web, used to show sketches of the final appearance of the application
Servo (P130)
<%= link_to "Help", "#"%>
#link_to的第一个参数是链接文本, the second parameter is the link address, the third parameter is optional, and is a hash.
One of the benefits of Asset pipeline is the ability to automatically optimize resource files for excellent use in production environments.
2, Sass: It is a language to write CSS, from a variety of aspects to enhance the functionality of CSS. The main features are two main functions: nesting and variables. Extension of sass File
Named. Scss, which is an extended set of CSS syntax. All valid CSS files are valid SCSS files. Rails ' Asset pipeline will automatically make
Files with the. scss extension are processed with the SASS preprocessor, so the Custom.css.scss file is processed first through the sass preprocessor and then introduced into the application
Style sheet, and then send it to the browser.
(1) Nesting:
{ text-align: center;} . Center H1 { margin-bottom: 10px;}
The nested format is as follows:
{ text-align: Center; h1{ margin-bottom: 10px; } }
{ float: left; margin-right: 10px;} { color: #fff; Text-decoration: none;}
The nested format is as follows:
{ float: left; margin-right: 10px; &:hover {#在SCSS中, using & conforming to a reference to the parent element color: #fff; Text-decoration: none; } }
(2) Variables:
{ color:#777;} { color:#777;}
Here's how to use variables:
{ color: $light-gray;} { color: $light-gray;}
3. Links in the layout
Named route: <%= link_to "About", About_path%> if the about_path corresponding URL is modified, the other places to use About_path
The new URL is automatically used.
Ruby on Rails Tutorial the fifth chapter perfect layout