Skip to content
This repository
Browse code

adds inline docs for dynamically created methods in Action Pack

  • Loading branch information...
commit 0ba8dcb444f6050a3dff35513c03dbc68841f54e 1 parent 8cabcbd
Xavier Noria authored December 27, 2008
8  actionpack/lib/action_controller/routing/route_set.rb
@@ -145,10 +145,10 @@ def named_helper_module_eval(code, *args)
145 145
           def define_hash_access(route, name, kind, options)
146 146
             selector = hash_access_name(name, kind)
147 147
             named_helper_module_eval <<-end_eval # We use module_eval to avoid leaks
148  
-              def #{selector}(options = nil)
149  
-                options ? #{options.inspect}.merge(options) : #{options.inspect}
150  
-              end
151  
-              protected :#{selector}
  148
+              def #{selector}(options = nil)                                            # def hash_for_users_url(options = nil)
  149
+                options ? #{options.inspect}.merge(options) : #{options.inspect}        #   options ? {:only_path=>false}.merge(options) : {:only_path=>false}
  150
+              end                                                                       # end
  151
+              protected :#{selector}                                                    # protected :hash_for_users_url
152 152
             end_eval
153 153
             helpers << selector
154 154
           end
6  actionpack/lib/action_view/helpers/form_helper.rb
@@ -737,9 +737,9 @@ def initialize(object_name, object, template, options, proc)
737 737
 
738 738
       (field_helpers - %w(label check_box radio_button fields_for)).each do |selector|
739 739
         src = <<-end_src
740  
-          def #{selector}(method, options = {})
741  
-            @template.send(#{selector.inspect}, @object_name, method, objectify_options(options))
742  
-          end
  740
+          def #{selector}(method, options = {})                                                       # def text_field(method, options = {})
  741
+            @template.send(#{selector.inspect}, @object_name, method, objectify_options(options))     #   @template.send("text_field", @object_name, method, objectify_options(options))
  742
+          end                                                                                         # end
743 743
         end_src
744 744
         class_eval src, __FILE__, __LINE__
745 745
       end

0 notes on commit 0ba8dcb

Please sign in to comment.
Something went wrong with that request. Please try again.