first commit
This commit is contained in:
18
app/views/modbus/index.html.erb
Normal file
18
app/views/modbus/index.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<% if flash[:notice] %>
|
||||
<div class="mb-4 rounded bg-green-100 px-4 py-2 text-green-800 border border-green-300">
|
||||
<%= flash[:notice] %>
|
||||
</div>
|
||||
<% elsif flash[:alert] %>
|
||||
<div class="mb-4 rounded bg-red-100 px-4 py-2 text-red-800 border border-red-300">
|
||||
<%= flash[:alert] %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% @schedule.each do |s| %>
|
||||
<div class="flex justify-items-center gap-x-2">
|
||||
<div><%= s.hour %>시</div>
|
||||
<div><%= s.temperature %> °C</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "수정", "/modbus/schedule_edit", class: "btn btn-primary" %>
|
||||
14
app/views/modbus/schedule_edit.html.erb
Normal file
14
app/views/modbus/schedule_edit.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<%= form_with url: "/modbus/schedule_edit_update", method: :post do %>
|
||||
<% @schedule.each do |s| %>
|
||||
<div class="flex justify-items-center gap-x-2 pb-2">
|
||||
<div><%= s.hour %>시</div>
|
||||
<div>
|
||||
<%= text_field_tag "schedule[#{s.id}][temperature]", s.temperature, class: "border px-2 py-1 rounded" %> °C
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="pt-4">
|
||||
<%= submit_tag "업데이트", class: "bg-blue-500 text-white px-4 py-2 rounded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user