Skip to content

Enhance the year in rails drop down list

February 17, 2011

In rails3 application, we create a scaffold in any date it display the limited years in date drop down list

enhance the year and fix the years what you want

to edit  a code in  apps/views/……/_form.html.erb


<%= f.date_select :purchased_on, :start_year => Time.now.year - 40, :end_year => Time.now.year + 10 %>

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: