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.
# RAILS_ENV = PRODUCTION # # 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? organization.logo else # There is 'logo.png' inside /app/assets/images/ asset_url('logo.png') end end
Problem I faced:
When condition is
organization.logo.present? == false
then it is supposed to generate a URL like
http://my_site.com/logo.png is generated. Point to be noted is, there isn’t even
/assets/ included in the URL.
# 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'] else # 'http://' is prepended assuming ENV['HOST'] = 'mysite.com' config.action_mailer.asset_host = 'http://' + ENV['HOST'] rescue '' end
yet to find. Please comment if you have any idea.