Database instance name needed on various pages

Would like to be better able to distinguish between development and production while viewing/updating data. After seeing a few examples that didn't work, found that I could just use this: ENV['RAILS_ENV'] in views which I put at the bottom as

<br><small><br><%= ENV['RAILS_ENV'][0..2] %></small> 

to be unobtrusive. Gives me 'dev', 'tes', and 'pro'. Still didn't work until I edited environment.rb and uncommented ENV['RAILS_ENV'] ||= 'production' AND changed it too ENV['RAILS_ENV'] = 'production' (no ||).
Was mostly able to use my _shared_links files to make the changes as DRY as possible.
Reminder: Still have some 'New' pages in Views that could be drier.

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