I want to use an input path
in the following code:
File.exists?(File.expand_path(path))
Can I use environment variables in path
, and what should the syntax be?
You can use standard ruby string interpolation (though it's a little bit wordy)
path = "log/#{ENV['RAILS_ENV']}.log" # or whatever
# >> "log/development.log"