<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -102,9 +102,9 @@ module RPH
       
     protected
       # renders the appropriate partial located in the template root
-      def render_partial_for(element, field, label, tip, template, helper, required, args)
+      def render_partial_for(element, field, label, tip, template, helper, required, extra_locals, args)
         errors = self.class.ignore_errors ? nil : error_message_for(field)
-        locals = { :element =&gt; element, :field =&gt; field, :builder =&gt; self, :object =&gt; object, :object_name =&gt; object_name, :label =&gt; label, :errors =&gt; errors, :tip =&gt; tip, :helper =&gt; helper, :required =&gt; required }
+        locals = extra_locals.merge(:element =&gt; element, :field =&gt; field, :builder =&gt; self, :object =&gt; object, :object_name =&gt; object_name, :label =&gt; label, :errors =&gt; errors, :tip =&gt; tip, :helper =&gt; helper, :required =&gt; required)
 
         @template.render :partial =&gt; &quot;#{self.class.template_root}/#{template}.html.erb&quot;, :locals =&gt; locals
       end
@@ -203,7 +203,7 @@ module RPH
           @template.capture(&amp;block)
         end  
         
-        partial = render_partial_for(element, field, label, tip, template_options[:template], 'widget', required, args)
+        partial = render_partial_for(element, field, label, tip, template_options[:template], 'widget', required, {}, args)
         RPH::FormAssistant::Rules.binding_required? ? @template.concat(partial, block.binding) : @template.concat(partial)
       end
       
@@ -214,6 +214,7 @@ module RPH
           options          = args.extract_options!
           label_options    = extract_options_for_label(field, options)
           template_options = extract_options_for_template(helper_name, options)
+          extra_locals     = options.delete(:locals) || {}
           
           # build out the label element (if desired)
           label = label_options[:label] === false ? nil : self.label(field, label_options.delete(:text), label_options)
@@ -236,7 +237,7 @@ module RPH
           return render_element(element, field, helper_name, options, label_options[:label] === false) if self.class.ignore_templates
           
           # render the partial template from the desired template root
-          render_partial_for(element, field, label, tip, template_options[:template], helper_name, required, args)
+          render_partial_for(element, field, label, tip, template_options[:template], helper_name, required, extra_locals, args)
         end
       end
       </diff>
      <filename>lib/form_assistant.rb</filename>
    </modified>
    <modified>
      <diff>@@ -143,4 +143,9 @@ class FormAssistantTest &lt; ActionView::TestCase
     
     expect_render :partial =&gt; template_path('field')  
   end
+  
+  test &quot;should pass extra locals&quot; do
+    form.text_field :first_name, :locals =&gt; { :nickname =&gt; true }
+    expect_locals :nickname =&gt; true
+  end
 end
\ No newline at end of file</diff>
      <filename>test/form_assistant_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>da5bc929a38242f97da16e36d2ee02942a76f7ae</id>
    </parent>
  </parents>
  <author>
    <name>Chris Scharf</name>
    <email>scharfie@gmail.com</email>
  </author>
  <url>http://github.com/rpheath/form_assistant/commit/c944d439228cddd2c4a633a443447f2917675386</url>
  <id>c944d439228cddd2c4a633a443447f2917675386</id>
  <committed-date>2009-03-24T09:24:29-07:00</committed-date>
  <authored-date>2009-03-24T07:46:44-07:00</authored-date>
  <message>Added ability to pass a :locals hash to a field helper to provide custom local variables to the template

Signed-off-by: Ryan Heath &lt;rpheath@gmail.com&gt;</message>
  <tree>08a546ccee38e5063cfa68eb58d5ad9b5e4407e1</tree>
  <committer>
    <name>Ryan Heath</name>
    <email>rpheath@gmail.com</email>
  </committer>
</commit>
