Skip to content

Instantly share code, notes, and snippets.

@macbury
Created January 25, 2016 13:12
Show Gist options
  • Save macbury/541c7fc3dc9c9bfdc66e to your computer and use it in GitHub Desktop.
Save macbury/541c7fc3dc9c9bfdc66e to your computer and use it in GitHub Desktop.
Sidekiq in iframe
%iframe#sidekiq_iframe{ src:"/admin/sidekiq" }
element = $('#sidekiq_iframe');
refresh_iframe_height = -> element[0].style.height = @contentWindow.document.body.offsetHeight + 50 + 'px';
element.load(refresh_iframe_height)
setInterval(refresh_iframe_height, 1000)
element.attr('src', attrs['src'])
require 'sidekiq/web'
Rails.application.routes.draw do
namespace :admin do
authenticate :admin_user, lambda { |current_user| current_user.present? && current_user.admin } do
mount Sidekiq::Web => '/workers'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment