, , . , , , :
/, . - app/vendor/templates/theme. ( //* .gitignore, - .) , , , . , , .
/. . , , :
+ vendor
- assets
- stylesheets
- vendor_sheets.css
vendor_sheets.css:
/stylesheets/applications.css:
Rails , . - , - , require vendor_sheets application.css, - , .
html-. , . , , index.html, , link ed index.html, vendor/assets/stylesheets *=require vendor_sheets.css , index.html.
require_tree. . .
- . . , . . , javascript. .
JavaScript , . vendor_scripts.js //javascripts, assets/application.js. Rails , jQuery Turbolinks ( ), . , " ", JavaScript .
. , //. config/application.rb // :
config.assets.paths << Rails.root.join("app", "assets", "vendor/assets/images")
.
/ , , url('. url('path/to/image/file_name.ext') image_path('file_name'). 6 7 , vendor/assets/fonts image_path `asset_path ('file_name.ext'). , , "scss" , styles.css, styles.css.scss.
, gem, Rails , , , . , , , .
Rails 4, .
HTML .html . . , .
Turbolinks: JavaScript , Turbolinks . Turbolinks, ... , Turbolinks , . JavaScript. JavaScript, :
$(document).on('ready', function() {
$(document).ready(function() {
- Turbolinks .
, , , application.html.erb:
<%=s tylesheet_link_tag "application", :media=>"all" %>
<%=j avascript_include_tag "application" %>
<%=c srf_meta_tags %>
<link href="css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" href="css/index.css" type="text/css" media="screen" />
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/lib/animate.css" media="screen, projection">
<%=s tylesheet, <%=j avascript <%=c srf . <%= stylesheet, <%= javascript <%= csrf.
, . application.css, . Google Font.
, Turbolinks. .
.