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::HelperSupport
|
||||||
extend Draper::DecoratesAssigned
|
extend Draper::DecoratesAssigned
|
||||||
|
|
||||||
before_filter do |controller|
|
before_filter :activate_draper
|
||||||
Draper::ViewContext.clear!
|
|
||||||
Draper::ViewContext.controller = controller
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,11 @@ module Draper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Set the current controller
|
||||||
|
def activate_draper
|
||||||
|
Draper::ViewContext.controller = self
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the current controller.
|
# Returns the current controller.
|
||||||
def self.controller
|
def self.controller
|
||||||
RequestStore.store[:current_controller]
|
RequestStore.store[:current_controller]
|
||||||
|
|
Loading…
Reference in New Issue