42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
<%= form_with model: @schedule, method: :post, data: { turbo: false }, class: 'flex flex-col h-full divide-y divide-border-table-border' do |form| %>
|
|
<%= form.hidden_field :controller_id, value: params[:id] %>
|
|
<div class="flex-1 p-4">
|
|
<span class="text-2xl font-bold"><%= Controller.find(params[:id]).name %> 컨트롤러</span>
|
|
<table class="base-table">
|
|
<thead>
|
|
<tr>
|
|
<th>시간</th>
|
|
<th>분</th>
|
|
<th>사용여부</th>
|
|
<th>온도</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<%= form.select :hour,
|
|
options_for_select((0..23).map { |h| [h.to_s.rjust(2, '0'), h] }, @schedule.hour),
|
|
{},
|
|
class: "input-style" %>
|
|
</td>
|
|
<td>
|
|
<%= form.number_field :minute,
|
|
min: 0, max: 59, step: 1, inputmode: "decimal", class: "input-style" %>
|
|
</td>
|
|
<td>
|
|
<%= check_box_tag "schedule[is_active]", "1", true %>
|
|
</td>
|
|
<td>
|
|
<%= form.number_field :temperature,
|
|
step: "0.1", inputmode: "decimal", class: "input-style" %>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="flex p-4">
|
|
<%= submit_tag "추가", class: "btn bg-primary" %>
|
|
</div>
|
|
<% end %>
|