2013-01-21 23 views
0

我一直在试图调整我的表单域的大小。我曾尝试使用尺寸像这样...如何调整date_select/time_select字段大小

<%= f.date_select(:form_date, order: [:month, :day, :year], prompt: { month: 'Select Month', day: 'Select Day', year: 'Select Year' }, start_year: 2000, size: 1) %> 

我只是在错误的顺序(大小:1不应该是最后一个)输入大小?这是否最好在我的样式表中处理?

在此先感谢。

回答

1

原来我是混合选项和html_options

date_select(object_name, method, options = {}, html_options = {}) Link 

这里是我改变了我的代码行从上面...

<%= f.date_select(:form_date, options = { order: [:month, :day, :year], prompt: { month: 'Select Month', day: 'Select Day', year: 'Select Year' }, start_year: 2000 }, html_options = { size: 1 }) %>