firstruby

Master ruby with us

Archive for October, 2009

Set default host for Mailer in RubyonRails

Posted by firstruby on October 16, 2009

We can set the default host for all of our methods in Mailer.

For this, we need to write one method in ApplicationController file with following code and call this method using before_filter,

ActionMailer::Base.default_url_options[:host] = request.host
or
ActionMailer::Base.default_url_options[:host] = request.host_with_port

Hope this will be helpful for someone.

Posted in Useful Links | Leave a Comment »