Modify select_year()

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.


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 :slight_smile:

Thanks - I should have caught that.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs