Answer the question
In order to leave comments, you need to log in
How to correctly link to a folder with photos in capistrano 2?
Pictures are stored in directories of the following form:
public/uploads/item/image/1/thumb_6.jpg
In deploy.rb I wrote the following:
set : shared_children, shared_children + %w{public/uploads}
However, as it turned out, such a symlink does not work, the application does not see the picture.
How to do it right?
Answer the question
In order to leave comments, you need to log in
The first time I saw the :shared_children option was in the second version.
Usually, the required directory was removed from the git, put into shared, and the hook was hung:
after 'deploy:update_code', roles: :app do
run "rm -f #{current_release}/public/uploads" # На всякий случай, если каким-то образом попал, например, симлинк
run "ln -s #{deploy_to}/shared/public/uploads/ #{current_release}/public/uploads"
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question