Don't think clear! is necessary, and give before_filter a name

This commit is contained in:
Tieg Zaharia 2013-12-18 15:23:44 -05:00
parent f260f211f2
commit d3cbec8283
2 changed files with 6 additions and 4 deletions

View File

@ -32,10 +32,7 @@ module Draper
extend Draper::HelperSupport
extend Draper::DecoratesAssigned
before_filter do |controller|
Draper::ViewContext.clear!
Draper::ViewContext.controller = controller
end
before_filter :activate_draper
end
end

View File

@ -10,6 +10,11 @@ module Draper
end
end
# Set the current controller
def activate_draper
Draper::ViewContext.controller = controller
end
# Returns the current controller.
def self.controller
RequestStore.store[:current_controller]