<%= form_with url: schedule_edit_update_schedules_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-table-border' do %>
<% @schedule.each do |s| %> <% end %>
시간 사용여부 온도 삭제
<%= select_tag "schedule[#{s.id}][hour]", options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, s.hour), class: "input-style" %> <%= number_field_tag "schedule[#{s.id}][minute]", s.minute, min: 0, max: 59, step: 1, inputmode: "decimal", class: "input-style" %> <%= check_box_tag "schedule[#{s.id}][is_active]", "1", s.is_active == true || s.is_active == 1 %> <%= number_field_tag "schedule[#{s.id}][temperature]", s.temperature, step: "0.1", inputmode: "decimal", class: "input-style" %> <%= link_to "삭제", schedule_path(s), data: { turbo_method: :delete, turbo_confirm: "정말 삭제하시겠습니까?" }, class: "btn bg-danger text-sm" %>
<%= submit_tag "업데이트", class: "btn bg-primary" %>
<% end %>
<%= button_to "초기화", reset_schedules_path, method: :post, data: { turbo_confirm: "정말 초기화하시겠습니까? 모든 스케줄 데이터가 삭제됩니다." }, class: "btn bg-danger" %>
<%= button_to "추가하기", open_modals_path(type: "add_schedule"), class: "btn bg-default-slate", data: { turbo_method: :post, turbo_frame: "modals" } %>