Class: Conjoin::FormBuilder::YearInput

Inherits:
SelectInput show all
Defined in:
lib/conjoin/inputs/year.rb

Instance Attribute Summary

Attributes inherited from Input

#app, #data, #options, #record

Instance Method Summary collapse

Methods inherited from SelectInput

#display, #render_opts

Methods inherited from Input

#display, #errors?, #id, #initialize, #nested_name, #render

Constructor Details

This class inherits a constructor from Conjoin::FormBuilder::Input

Instance Method Details

#select_optionsObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/conjoin/inputs/year.rb', line 6

def select_options
  years_select = {}
  years = (1900..(Date.today.year+2)).to_a.reverse!

  years.each do |year|
    years_select[year] = year.to_s
  end

  years_select
end