Hi -
Does anyone know how to add a selection to this helper:
--
select_year(date, options = {}, html_options = {})
--
I would like to precede it with ''Select a year'' just as I
would if I
were using .unshift.
Right now the control is fully populated from start to end year.
Any ideas appreciated - figured best to ask before having to write a
custom helper.
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
If you''re running Rails 2.3 then select_year accepts the :prompt option, so... select_year(date, :prompt => ''Select a year'') ...would work. If you''re on an older version of Rails, you''ll need to do some DIY :) On Mar 11, 5:02 pm, northband <northb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi - > > Does anyone know how to add a selection to this helper: > -- > select_year(date, options = {}, html_options = {}) > -- > > I would like to precede it with ''Select a year'' just as I would if I > were using .unshift. > > Right now the control is fully populated from start to end year. > > Any ideas appreciated - figured best to ask before having to write a > custom helper. > > Thanks!--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Thanks - I should have caught that. Best, NB On Mar 12, 5:02 am, rob-twf <rob.ander...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> If you''re running Rails 2.3 then select_year accepts the :prompt > option, so... > > select_year(date, :prompt => ''Select a year'') > > ...would work. If you''re on an older version of Rails, you''ll need to > do some DIY :) > > On Mar 11, 5:02 pm, northband <northb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi - > > > Does anyone know how to add a selection to this helper: > > -- > > select_year(date, options = {}, html_options = {}) > > -- > > > I would like to precede it with ''Select a year'' just as I would if I > > were using .unshift. > > > Right now the control is fully populated from start to end year. > > > Any ideas appreciated - figured best to ask before having to write a > > custom helper. > > > Thanks!--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---