Hi

I have presently the following view :

<div>
        <p><%= f.label :tz_area,  I18n.t("label.form.tz_area")  %></p/>
        <div id="tz_area_selector">
                <p>
                   <%= f.label :timezone,
I18n.t("label.form.timezone")  %><br />
                    <%=
f.time_zone_select :time_zone, /"#[email protected]_area}"/, :default =>
@instructor.time_zone   %>
                </p>
        </div>
</div>

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

<div>
        <p><%= f.label :tz_area,  I18n.t("label.form.tz_area")  %></p/>

        <div id="tz_area_selector">
              <%= render :partial => "tz_selector", :locals => { :f =>
f } %>
        </div>

</div>

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



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to