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. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Jun-22 21:45 UTC
Re: 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?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. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abder-rahman Ali
2010-Jun-22 21:56 UTC
Re: Why am I onlu limited by the years from 2005-2015?
Philip Hallstrom 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. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Jun-22 22:00 UTC
Re: Re: Why am I onlu limited by the years from 2005-2015?
On Jun 22, 2010, at 2:56 PM, Abder-rahman Ali wrote:> Philip Hallstrom 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?In the view file. Find the file that has the form and then look for date_select and add the options... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abder-rahman Ali
2010-Jun-22 22:10 UTC
Re: Re: Why am I onlu limited by the years from 2005-2015?
Philip Hallstrom 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 -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-Jun-22 22:25 UTC
Re: Re: Re: Why am I onlu limited by the years from 2005-2015?
On Jun 22, 2010, at 3:10 PM, Abder-rahman Ali wrote:> Philip Hallstrom 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.erbRight. And one of those .html.erb files will have the field you want... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abder-rahman Ali
2010-Jun-23 00:50 UTC
Re: Re: Re: Why am I onlu limited by the years from 2005-2015?
Philip Hallstrom 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: </p> 14: <p> 15: <%= f.label :dob %><br /> 16: <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %> 17: </p> 18: <p> 19: <%= f.label :major %><br /> Thanks. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
botp
2010-Jun-23 02:55 UTC
Re: Re: Re: Re: Why am I onlu limited by the years from 2005-2015?
On Wed, Jun 23, 2010 at 8:50 AM, Abder-rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 16: <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %>you''ll need the object and method, http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002264 kind regards -botp -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abder-rahman Ali
2010-Jun-23 09:23 UTC
Re: Re: Re: Re: Why am I onlu limited by the years from 2005-2015?
botp wrote:> On Wed, Jun 23, 2010 at 8:50 AM, Abder-rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: >> 16: � � <%= f.date_select(:start_year=>1950, :end_year=>2010) :dob %> > > you''ll need the object and method, > > http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002264 > > kind regards -botpThanks a lot botp. Yes, I wasn''t aware of the correct syntax. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.