Permalink
Browse files

adds inline docs for dynamically created methods in Action Pack

  • Loading branch information...
1 parent 8cabcbd commit 0ba8dcb444f6050a3dff35513c03dbc68841f54e @fxn fxn committed Dec 27, 2008
@@ -145,10 +145,10 @@ def named_helper_module_eval(code, *args)
def define_hash_access(route, name, kind, options)
selector = hash_access_name(name, kind)
named_helper_module_eval <<-end_eval # We use module_eval to avoid leaks
- def #{selector}(options = nil)
- options ? #{options.inspect}.merge(options) : #{options.inspect}
- end
- protected :#{selector}
+ def #{selector}(options = nil) # def hash_for_users_url(options = nil)
+ options ? #{options.inspect}.merge(options) : #{options.inspect} # options ? {:only_path=>false}.merge(options) : {:only_path=>false}
+ end # end
+ protected :#{selector} # protected :hash_for_users_url
end_eval
helpers << selector
end
@@ -737,9 +737,9 @@ def initialize(object_name, object, template, options, proc)
(field_helpers - %w(label check_box radio_button fields_for)).each do |selector|
src = <<-end_src
- def #{selector}(method, options = {})
- @template.send(#{selector.inspect}, @object_name, method, objectify_options(options))
- end
+ def #{selector}(method, options = {}) # def text_field(method, options = {})
+ @template.send(#{selector.inspect}, @object_name, method, objectify_options(options)) # @template.send("text_field", @object_name, method, objectify_options(options))
+ end # end
end_src
class_eval src, __FILE__, __LINE__
end

0 comments on commit 0ba8dcb

Please sign in to comment.