diff options
Diffstat (limited to 'actionpack/lib/action_controller/components.rb')
-rw-r--r-- | actionpack/lib/action_controller/components.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb index 5ef6e2afba..7f7ecfff78 100644 --- a/actionpack/lib/action_controller/components.rb +++ b/actionpack/lib/action_controller/components.rb @@ -36,20 +36,20 @@ module ActionController #:nodoc: # So to repeat: Components are a special-purpose approach that can often be replaced with better use of partials and filters. module Components def self.included(base) #:nodoc: - base.send :include, InstanceMethods - base.extend(ClassMethods) + base.class_eval do + include InstanceMethods + extend ClassMethods - base.helper do - def render_component(options) - @controller.send(:render_component_as_string, options) + helper do + def render_component(options) + @controller.send!(:render_component_as_string, options) + end end - end - # If this controller was instantiated to process a component request, - # +parent_controller+ points to the instantiator of this controller. - base.send :attr_accessor, :parent_controller + # If this controller was instantiated to process a component request, + # +parent_controller+ points to the instantiator of this controller. + attr_accessor :parent_controller - base.class_eval do alias_method_chain :process_cleanup, :components alias_method_chain :set_session_options, :components alias_method_chain :flash, :components @@ -162,4 +162,4 @@ module ActionController #:nodoc: end end end -end
\ No newline at end of file +end |