Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
RailsGuide
app/assetsapp/assets/javascriptsapp/assets/stylesheetsapp/assets/imageslib/assetsvendor/assets
stylesheet_link_tagjavascript_include_tagimage_tagasset_pathasset_data_urlrequirerequire_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.htmlhttp://guides.rubyonrails.org/security.htmlhttp://guides.rubyonrails.org/working_with_javascript_in_rails.htmlhttp://guides.rubyonrails.org/asset_pipeline.htmlhttp://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html