Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion How to use start_year and end_year on a date column
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Vorik  
View profile  
 More options Apr 17 2007, 3:30 am
From: Vorik <goo...@gerapeldoorn.nl>
Date: Tue, 17 Apr 2007 00:30:46 -0700
Local: Tues, Apr 17 2007 3:30 am
Subject: Re: How to use start_year and end_year on a date column
Thanks for the tip Lance, but I'm not there yet.... This is what I've
come up with:

---------------leerling_helper.rb---------------
module Admin::LeerlingHelper
  def geboortedatum_form_column(record, input_name)
    select_date record[:geboortedatum], :name =>
'geboortedatum', :order => [:day, :month, :year], :start_year =>
1970, :end_year => 2000
  end
end
---------------/leerling_helper.rb---------------

The override is beiing used (order changed), but the values are not
beiing stored to the database.

I think it is because of the select's name. Here is an excerpt of the
html-source that is generated:
---------------%<---------------
<label for="record_geboortedatum">Geboortedatum</label>
<select id="date_day" name="date[day]">
<option value="1">1</option>
<option value="2">2</option>
---------------%<---------------

Shouldn-t that be name="geboortedatum[day]"?

how can I change it?

Many thanks,
Ger.
On 16 apr, 20:30, "Lance Ivy" <l...@cainlevy.net> wrote:

> Hi Ger,

> Your best bet here is probably to override the column on the form and
> customize it exactly how you want it. Check outhttp://activescaffold.com/docs/form-overrides.

> On 4/15/07, Vorik <goo...@gerapeldoorn.nl> wrote:

> > Hi all,

> > I'm trying to insert a record containing a birthdate with
> > activescaffold. However, the year-dropdown box is only showing years
> > starting from 2002. This means that people over 5 years old cannot use
> > the application which, unfortunately, does not meet the functional
> > requirements. (Would save lots of difficult questions though!)

> > How can I set the starting year? With standard rails it is set like
> > this:

> > date_select :geboortedatum, :order =>
> > [:day, :month, :year], :start_year => 1970, :end_year => 2000

> > The funny thing is that in 'edit mode', the years start at 1969 but in
> > 'new' mode it starts at 2002.

> > Thanks in advance,
> > Ger Apeldoorn


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.