[英]How to use the date_select and time_select in the form in rails?
[英]How to adjust date_select / time_select field size
我一直在嘗試調整表單字段的大小。 我曾嘗試使用像這樣的尺寸...
<%= 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)? 這是我的樣式表中處理得最好的嗎?
提前致謝。
原來我在混用選項和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 }) %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.