Module

UrlWriter

Write URLs from arbitrary places in your codebase, such as your mailers.

Example:

 class MyMailer
   include ActionController::UrlWriter
   default_url_options[:host] = 'www.basecamphq.com'

   def signup_url(token)
     url_for(:controller => 'signup', action => 'index', :token => token)
   end
end

In addition to providing url_for, named routes are also accessible after including UrlWriter.

Public Methods
included
url_for Generate a url based on the options provided, default_url_options and the routes defined in routes.rb. The following options are supported:
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.