Why am I onlu limited by the years from 2005-2015?

I have created a scaffold, part of which was dob:date

When I view my web page under DOB, I have only the years listed from
2005-2015. What should I do to enter older years?

Thanks.

I have created a scaffold, part of which was dob:date

When I view my web page under DOB, I have only the years listed from
2005-2015. What should I do to enter older years?

See the docs for date_select (even if it’s a datetime_select the same
options work). Specifically:

:start_year - Set the start year for the year select. Default is
Time.now.year - 5.
:end_year - Set the end year for the year select. Default is
Time.now.year + 5.

Philip H. wrote:

I have created a scaffold, part of which was dob:date

When I view my web page under DOB, I have only the years listed from
2005-2015. What should I do to enter older years?

See the docs for date_select (even if it’s a datetime_select the same
options work). Specifically:

:start_year - Set the start year for the year select. Default is
Time.now.year - 5.
:end_year - Set the end year for the year select. Default is
Time.now.year + 5.

Thanks Philip.

I’m actually new to RoR. Where can I make this change?

Thanks.

Philip H. wrote:

On Jun 22, 2010, at 2:56 PM, Abder-rahman Ali wrote:

Time.now.year - 5.
:end_year - Set the end year for the year select. Default is
Time.now.year + 5.

Thanks Philip.

I’m actually new to RoR. Where can I make this change?

In the view file. Find the file that has the form and then look for
date_select and add the options…

If you mean the “views” folder, there is nothing actually on it. Just
*.html.erb

On Jun 22, 2010, at 2:56 PM, Abder-rahman Ali wrote:

Time.now.year - 5.
:end_year - Set the end year for the year select. Default is
Time.now.year + 5.

Thanks Philip.

I’m actually new to RoR. Where can I make this change?

In the view file. Find the file that has the form and then look for
date_select and add the options…

On Jun 22, 2010, at 3:10 PM, Abder-rahman Ali wrote:

In the view file. Find the file that has the form and then look for
date_select and add the options…

If you mean the “views” folder, there is nothing actually on it. Just
*.html.erb

Right. And one of those .html.erb files will have the field you want…

Philip H. wrote:

On Jun 22, 2010, at 3:10 PM, Abder-rahman Ali wrote:

In the view file. Find the file that has the form and then look for
date_select and add the options…

If you mean the “views” folder, there is nothing actually on it. Just
*.html.erb

Right. And one of those .html.erb files will have the field you want…

I found the date_select, but got the following error. Any ideas?

compile error
/Users/abder/Desktop/RoR
projects/student_info/app/views/students/new.html.erb:16: syntax error,
unexpected ‘:’, expecting ‘)’
…year=>1950, :end_year=>2010) :dob ).to_s); @output_buffer.co

Extracted source (around line #16):

13:


14:


15: <%= f.label :dob %>

16: <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %>
17:


18:


19: <%= f.label :major %>

Thanks.

botp wrote:

On Wed, Jun 23, 2010 at 8:50 AM, Abder-rahman Ali [email protected]
wrote:

16: � � <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %>

you’ll need the object and method,

ActionView::Helpers::DateHelper

kind regards -botp

Thanks a lot botp.

Yes, I wasn’t aware of the correct syntax.

On Wed, Jun 23, 2010 at 8:50 AM, Abder-rahman Ali [email protected]
wrote:

16: <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %>

you’ll need the object and method,

kind regards -botp