-
Notifications
You must be signed in to change notification settings - Fork 0
RailsGuide
app/assets
app/assets/javascripts
app/assets/stylesheets
app/assets/images
lib/assets
vendor/assets
stylesheet_link_tag
javascript_include_tag
image_tag
asset_path
asset_data_url
require
require_tree
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= image_tag "rails.png" %>
application.css.erb
.class { background-image: url(<%= asset_path 'image.png' %>) }
#logo { background: url(<%= asset_data_uri 'logo.png' %>) }
// ...
//= require jquery
//= require jquery_ujs
//= require_tree .
-
Pipeline assets can be placed inside an application in one of three locations: app/assets, lib/assets or vendor/assets.
-
app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.
-
lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.
-
vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks.
-
When a file is referenced from a manifest or a helper, Sprockets searches the three default asset locations for it.
-
The default locations are: app/assets/images and the subdirectories javascripts and stylesheets in all three asset locations, but these subdirectories are not special. Any path under assets/* will be searched.
https://github.com/sstephenson/sprockets Rack-based asset packaging system CoffeeScript, Sass, SCSS and LESS.
https://github.com/amatsuda/kaminari A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3
http://guides.rubyonrails.org/layouts_and_rendering.html http://guides.rubyonrails.org/security.html http://guides.rubyonrails.org/working_with_javascript_in_rails.html http://guides.rubyonrails.org/asset_pipeline.html http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html