I need to create a “global” variable. I create it in the file boot.rb.
RAILS_CAR_IMAGES = Rails.root.to_s + “/app/assets/images/” unless defined?(RAILS_CAR_IMAGES)
But it pops up an error.
“uninitialized constant Rails (NameError)”
Where should I create a global variable (contains path relative to the root folder) to save the uploaded images?
In
boot.rbRails has not been initialized … Create a file inconfig/initializerswith a name like car_images.rb and put the code there