Friday, 23 August 2013

Rails environment variables in .yml file with Rails Admin

Rails environment variables in .yml file with Rails Admin

I'm trying to set a rails environment variable in a separate yml file. and
it looks like this:
test:
sap_url: "http://example.com/"
development:
show_evp: 'true'
show_social_media: "true"
production:
show_evp: 'true'
show_social_media: "true"
staging:
show_evp: 'true'
show_social_media: "true"
And in my rails admin I do the following
config.model Settings do
weight 1
list do
field :id
field :show_hot_jobs
if ENV['SHOW_EVP'] == 'true'
field :show_evp
end
field :show_students
field :show_testimonials
field :show_on_boarding
end
But the variable is always false, anyone have an idea of where I need to
set these rails env variables or what is wrong with mine.
Kr, Vincent

No comments:

Post a Comment