I have the following form:
<%= form_for(@car, :html => {:class => 'form-horizontal' }) do |f| %> <% if @car.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@car.errors.count, "error") %> prohibited this car from being saved</h2> <ul> <% @car.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :price %><br /> <%= f.text_field :price %> </div> <div class="field"> <%= f.label :model_year %><br /> <% %> <% end %> </div>
I want the selection of a collection for the model year to start 100 years ago and be about a year in the future. I tried
<%= f.select_year :model_year%>
but he says select_year is not a valid method. I tried
<%= f.date :model_year, :discard_month => true %>
also to no avail. Any thoughts?
date ruby-on-rails simple-form form-for
mano26
source share