Ruby On Rails : Engineyard : ActionMailer’s asset_url helper method not working as expected

I have been using Engineyard as PaaS for deploying my Ruby On Rails application. To have my app server intact I have created a utility instance called ‘redis’ to host Redis-Server and Sidekiq.


 # Gets the logo URL of the Organization set by Controller/Mailer
 #   in instance variable @organization
 # @param [Organization] organization default value is nil
 # @return [String] URL for logo image
 def get_logo_url(organization = nil)
   if organization && organization.logo.present?
     # There is 'logo.png' inside /app/assets/images/

Problem I faced:

When condition is

organization.logo.present? == false

then it is supposed to generate a URL like however, is generated. Point to be noted is, there isn’t even /assets/ included in the URL.

# source: app/config/environment/production.rb 
# Disable Rails's static asset server (Apache or nginx will already do this).
 config.serve_static_assets = false

 # Compress JavaScripts and CSS.
 config.assets.js_compressor = :uglifier
 config.assets.css_compressor = :sass

 # Do not fallback to assets pipeline if a pre-compiled asset is missed.
 config.assets.compile = false

 # Generate digests for assets URLs.
 config.assets.digest = true
 # Source: app/config/application.rb
 # Helps helper methods like 'asset_path' to get absolute path of asset
 if ENV['HOST'] && ENV['HOST'][0..3].downcase == 'http'
   config.action_mailer.asset_host = ENV['HOST']
   # 'http://' is prepended assuming ENV['HOST'] = ''
   config.action_mailer.asset_host = 'http://' + ENV['HOST'] rescue ''


yet to find. Please comment if you have any idea.


One thought on “Ruby On Rails : Engineyard : ActionMailer’s asset_url helper method not working as expected

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s