This means app-name.heroku.com.
Note this is different from Rails.application.class.parent_name.
Rails.application.class.parent_name is defined in the application.
Working in Rails 3.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Heroku actually sets a URL variable in the environment by default
Referenced here: http://devcenter.heroku.com/articles/config-vars and http://ididitmyway.heroku.com/past/2010/11/9/sinatra_settings_and_configuration/
update: actually the URL variable might not be there by default, but you could always add an environment variable “app name” a priori, unless you were trying to avoid that approach all together.
update 2: indeed, the other, obvious but limiting approach, would be to grab the domain off the request variable, but this limits you to your controller. http://guides.rubyonrails.org/action_controller_overview.html#the-request-object