app/controllers/trestle/application_controller.rb in trestle-0.8.5 vs app/controllers/trestle/application_controller.rb in trestle-0.8.6
- old
+ new
@@ -1,9 +1,9 @@
class Trestle::ApplicationController < ActionController::Base
protect_from_forgery
- layout 'trestle/admin'
+ layout :choose_layout
# Global helpers
self.helpers_path += Rails.application.helpers_paths
helper Trestle.config.helper_module
helper *Trestle.config.helpers
@@ -29,6 +29,10 @@
def breadcrumb(label, path=nil)
breadcrumbs.append(label, path)
end
helper_method :breadcrumb
+
+ def choose_layout
+ request.xhr? ? false : "trestle/admin"
+ end
end