Problem with date_select

Hi all.
I have a big problem with date_select helper, because i guess it can’t
resolve local variables to set correctly selected date.

Small example:

<% @client.charge_regs.each do |creg| %>
<%= form_remote_tag with_progress(:url => { :action => ‘foo’ }) %>
<%= date_select ‘creg’, ‘valid_before’ %>
<% end_form_tag %>
<% end %>

selected date will be assigned to current date instead of ‘valid_before’
value of ‘creg’ variable in loop.
Is it possible to fix it?
Thx in advance.

zven wrote:

<% @client.charge_regs.each do |creg| %>
<%= form_remote_tag with_progress(:url => { :action => ‘foo’ }) %>
<%= date_select ‘creg’, ‘valid_before’ %>
<% end_form_tag %>
<% end %>

selected date will be assigned to current date instead of ‘valid_before’
value of ‘creg’ variable in loop.

Form helpers work on instance variables, so you want:

<% @client.charge_regs.each do |@creg| %>


We develop, watch us RoR, in numbers too big to ignore.

On Wed, 2006-08-02 at 17:49 +1000, Mark Reginald J. wrote:

Form helpers work on instance variables, so you want:

<% @client.charge_regs.each do |@creg| %>

Ok. thank you very much.

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