Merge pull request #592 from tiegz/before_filter_name
Give before_filter a name
This commit is contained in:
commit
05a5dff7fc
|
@ -33,10 +33,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 = self
|
||||
end
|
||||
|
||||
# Returns the current controller.
|
||||
def self.controller
|
||||
RequestStore.store[:current_controller]
|
||||
|
|
Loading…
Reference in New Issue