Don't think clear! is necessary, and give before_filter a name
This commit is contained in:
parent
f260f211f2
commit
d3cbec8283
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue