I had request.env['http_host']
working on localhost, but it causes an error when referenced in a layout page on heroku.
This request works in a view and displays the correct base url, but it causes an error when I move the code to the layout. Note - I'm using this to build absolute urls for images in html emails.
<%= "#{request.env['HTTP_HOST']}/assets/email_header_image.png" %>
<%= image_tag "#{request.env['HTTP_HOST']}/assets/email_header_image.png" %>
error received:
ActionView::Template::Error (undefined method `env' for nil:NilClass):