When working on a small scale, assets are stored in the public/ directory of your Rails application, but you can put them on a
separate server and tell Rails where to find them through
ActionController::Base.asset_host. A separate server can speed delivery, let
you share assets with other applications, or just reduce the amount of work your Rails
application has to do itself.
The methods in
AssetTagHelper will assume files are
in your public/ directory unless you’ve
specified otherwise. Most of them generate HTML tags for you, though a few let you specify
ways to generate tags in the future.
The methods you should probably focus on initially include:
Lets you specify the location of an RSS or Atom feed.
Returns an HTML
img tag for the specified image
you identify as parameters. If one of the parameters is
:defaults, the application.js file
will be included, bringing in the Prototype and Script.aculo.us libraries. You can
provide full paths to your scripts, even scripts on other servers, or you can just
provide the file’s name. If you’re feeling fancy, you can define groups
of styles with