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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With