【发布时间】:2015-02-08 00:41:05
【问题描述】:
<%= f.select :minutes, options_for_select([['1 hour', 60], ['1 hour and a half', 90], ['2 hours', 120]][0..(@minutes_to_schedule/30-2)], 60), {}, {disabled: true} %>
我检查了表单助手 API,但尽管遵循了我的选项,但我的选项仍然没有被禁用,有什么我忽略的吗?我看了看其他堆积的帖子,似乎没有做错什么
<%= form_for(@session_date, html: {class: 'no_custom'}) do |f| %>
<%= f.hidden_field :student_id, value: @student.id %>
<%= hidden_field_tag 'from', schedule_student_path(id: @student.id) %>
<div id="appointment_display"></div>
<input id="appointment_at" type="datetime-local" name="appointment[at]" step="900" min= "some_time" max="max_time" required="required" placeholder="Use Chrome!" style="width: auto; display: none;"/>
<br/>
<div id="appointment_location_display"></div>
<br/>
<%= f.select :minutes, options_for_select(@appointment_time_options, 60) %>
<br/>
<%= f.collection_select(:location_id, Location.order('city, state, address'), :id, :name, {}, {class: 'dont_display'}) %>
<%= f.submit 'Create Appointment' %>
<br/>
<% end %>
【问题讨论】:
标签: ruby forms select ruby-on-rails-4 disabled-input