我已经time_select
了,我想在输入中添加自定义名称和ID,我试过:
<td>
<%= f_messenger.time_select :schedules,
:id => "messenger_schedules_#{day}_end",
:name => "messenger[schedules][#{day}][end]"
%>
</td>
如果我尝试使用文本输入它可以工作,但在time_select
我得到类似的东西:
<select id="messenger_schedules_4i" name="messenger[schedules(4i)]">
任何想法?
答案 0 :(得分:0)
您可以尝试以下代码:
<td>
<%= f_messenger.time_select :schedules, '', prompt: {},
id: "messenger_schedules_#{day}_end",
name: "messenger[schedules][#{day}][end]"
%>
</td>