Forum: Ruby on Rails date select box's

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B5a793b425c4db1f45c3cdfec5697047?d=identicon&s=25 scott (Guest)
on 2006-06-07 11:35
Hi

I have the following date select box

<%= date_select 'min', 'min'  %>

When you submit a date, it re-loads the page with the same date select
box, but displays todays date, no matter what you submitted before.

How can I get it to re load with the submitted date.

Thanks
Scott
C75369f25cd6b34076875bdc308c2aca?d=identicon&s=25 John Russell (jjrussell)
on 2006-06-07 13:14
scott wrote:
> Hi
>
> I have the following date select box
>
> <%= date_select 'min', 'min'  %>
>
> When you submit a date, it re-loads the page with the same date select
> box, but displays todays date, no matter what you submitted before.
>
> How can I get it to re load with the submitted date.

check out date_select in the Rails Framework Documentation.  The first
argument is object and the second one is method.  If you have defined an
instance variable object which matches what you put in the date_select
argument for object which has a method matching what you put for method
then the date_select parts will take that value when the page loads.

Create a sample rails app and check out the edit page.  It uses dates
there and gets them to autopopulate.
B5a793b425c4db1f45c3cdfec5697047?d=identicon&s=25 Scott Sherwood (asherwood)
on 2006-06-09 14:35
still a bit unsure on what you mean here

the date select returns values in an array

with 3 values params['max']['max(1i)'] ,2i and 3i

but I have been unable to create an array with these names, the key
seems to want an int and not a string, any suggestions?

or am I on the wrong path all toggether?

Scott
This topic is locked and can not be replied to.