Skip to content

Commit

Permalink
Ruby 1.9 compat: workaround module_eval issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Apr 11, 2008
1 parent 4364c36 commit 13e7849
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions actionpack/lib/action_controller/components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ def self.included(base) #:nodoc:
base.class_eval do
include InstanceMethods
extend ClassMethods

helper do
def render_component(options)
@controller.send!(:render_component_as_string, options)
end
end
helper HelperMethods

# If this controller was instantiated to process a component request,
# +parent_controller+ points to the instantiator of this controller.
Expand All @@ -67,6 +62,12 @@ def process_with_components(request, response, parent_controller = nil) #:nodoc:
end
end

module HelperMethods
def render_component(options)
@controller.send!(:render_component_as_string, options)
end
end

module InstanceMethods
# Extracts the action_name from the request parameters and performs that action.
def process_with_components(request, response, method = :perform_action, *arguments) #:nodoc:
Expand Down

0 comments on commit 13e7849

Please sign in to comment.