Skip to content

Instantly share code, notes, and snippets.

@Syntaf
Created August 8, 2020 18:23
Show Gist options
  • Save Syntaf/50a94affc07fb0bacb5ec5f7bb802216 to your computer and use it in GitHub Desktop.
Save Syntaf/50a94affc07fb0bacb5ec5f7bb802216 to your computer and use it in GitHub Desktop.
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :reload_admin, if: :rails_admin_path?
private
# implemented in step three
def reload_admin; end
# Returns true if the requested controller contains rails_admin
# change this as needed if you're using custom controllers
def rails_admin_path?
controller_path =~ /rails_admin/ && Rails.env.development?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment