Nested partials parameters

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs