app/controllers/trestle/application_controller.rb in trestle-0.8.6 vs app/controllers/trestle/application_controller.rb in trestle-0.8.7

- old
+ new

@@ -1,38 +1,10 @@ class Trestle::ApplicationController < ActionController::Base protect_from_forgery - layout :choose_layout - - # Global helpers - self.helpers_path += Rails.application.helpers_paths - helper Trestle.config.helper_module - helper *Trestle.config.helpers - - # Global callbacks - Trestle.config.before_actions.each do |action| - before_action(action.options, &action.block) - end - - Trestle.config.after_actions.each do |action| - after_action(action.options, &action.block) - end - - Trestle.config.around_actions.each do |action| - around_action(action.options, &action.block) - end - -protected - def breadcrumbs - @breadcrumbs ||= Trestle::Breadcrumb::Trail.new(Trestle.config.root_breadcrumbs) - end - helper_method :breadcrumbs - - def breadcrumb(label, path=nil) - breadcrumbs.append(label, path) - end - helper_method :breadcrumb - - def choose_layout - request.xhr? ? false : "trestle/admin" - end + include Trestle::Controller::Breadcrumbs + include Trestle::Controller::Callbacks + include Trestle::Controller::Dialog + include Trestle::Controller::Helpers + include Trestle::Controller::Layout + include Trestle::Controller::Location end