# Nested partials parameters

**URL:** <https://www.ruby-forum.com/t/nested-partials-parameters/184304>\
**Category:** Rails\
**Created:** [February 28, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/nested-partials-parameters/184304 "2010-02-28T16:35:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [February 28, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/nested-partials-parameters/184304/1 "2010-02-28T16:35:49Z")

</div>

Hi

I have presently the following view :

\<%= f.label :tz\_area, I18n.t("label.form.tz\_area") %\>

\<%= f.label :timezone, I18n.t("label.form.timezone") %\>  
 \<%= f.time\_zone\_select :time\_zone, /"#{@instructor.tz\_area}"/, :default =\> @instructor.time\_zone %\>

As I need to modify the time\_zone\_select when another field is  
modified, I’ll use an Ajax request , so I am using a partial and  
replaced this code with

\<%= f.label :tz\_area, I18n.t("label.form.tz\_area") %\>

 \<%= render :partial =\> "tz\_selector", :locals =\> { :f =\> f } %\> 

the Ajax request is performed, and my controller try to replace the  
partial  
…  
render :update do |page|  
page.replace\_html ‘time\_zone\_selector’, :partial =\>  
“time\_zone\_selector”, :locals =\> { :f =\> f }  
end

but obviously I get an error ,as f is undefined :

NameError (undefined local variable or method `f’

how can I replace this piece of the form ?

thanks

erwin
