Created
August 8, 2020 18:23
-
-
Save Syntaf/50a94affc07fb0bacb5ec5f7bb802216 to your computer and use it in GitHub Desktop.
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
# 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