Created
March 24, 2011 19:04
-
-
Save jmcnevin/885637 to your computer and use it in GitHub Desktop.
Rails 3, Devise, Resque, Capistrano, and static resque-web assets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm currently using Devise along with Resque's resque-web UI. I have resque-web running | |
# as an embedded rack application inside of my main Rails app with the following line in my | |
# my routes.rb file: | |
# | |
# mount Resque::Server.new, :at => "/resque" | |
# | |
# This makes resque-web expect its static assets to be found in your site's /public/resque | |
# folder, where they won't be. | |
# | |
# The answer is to copy or symlink to those assets which are found in the gem's own public | |
# directory. The following capistrano task will take care of that for you. | |
# | |
# This recipe assumes you're using Bundler. | |
desc "Copy resque-web assets into public folder" | |
task :copy_resque_assets do | |
target = File.join(release_path,'public','resque') | |
run "cp -r `cd #{release_path} && bundle show resque`/lib/resque/server/public #{target}" | |
end | |
after "deploy:restart", "deploy:copy_resque_assets" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment