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