lib/admin_it/controller.rb in admin_it-1.0.11 vs lib/admin_it/controller.rb in admin_it-1.1.0
- old
+ new
@@ -1,10 +1,12 @@
module AdminIt
+ #
module Controller
def self.included(base)
base.class_eval do
include Pundit if AdminIt::Env.pundit?
+ before_filter :authenticate_user!
attr_reader :context
helper_method :context, :resource
helper AdminIt::Helpers
helper AdminIt::Engine.routes.url_helpers
@@ -29,10 +31,10 @@
def load_context(context_class)
@context = context_class.new(self)
yield if block_given?
layout = ['admin_it', params[:layout]].compact.join('_')
- if !performed?
+ unless performed?
if layout == 'admin_it' && !request.query_parameters.empty?
redirect_to request.path
else
render template: "admin_it/#{context.name}", layout: layout
end