Carrierwave by default takes in the url generated by store_dir
in the uploader and prepends the path to the public folder of the rails application and stores the files.
For example if
def store_dir
"uploads/#{model.id}"
end
then the file is stored at public/uploads/:attachment_id
If one tries to move the stored files out of the public folder still it saves in the public folder. Does anyone have an idea of how to store the files outside the public folder??
I realize this isn't really a current question, but I stumbled on it looking for something else. The answer is simply to use Rails.root, eg:
A much more cleaner solution would be to define:
See the docs
the cleanest way to do this, is by setting the CarrierWave root option
then
store_dir
will be used inside this root.If someone need that just for RSpec then just do
if you want that for all your tests
Inside the store dir you can also do something like this:
the solution of changing the config_root didn't work for me.