-
-
- <% if flash[:notice] %>
-
- <%= raw flash[:notice] %>
-
- <% elsif flash[:alert] %>
-
- <%= raw flash[:alert] %>
-
- <% end %>
- <%= yield %>
+
+ <%= render "partials/sidebar" %>
+
diff --git a/app/views/partials/_sidebar.html.erb b/app/views/partials/_sidebar.html.erb
index f2f9f61..a51fa6d 100644
--- a/app/views/partials/_sidebar.html.erb
+++ b/app/views/partials/_sidebar.html.erb
@@ -7,30 +7,16 @@
HOME
+
+ <% if flash[:notice] %>
+
+ <%= raw flash[:notice] %>
+
+ <% elsif flash[:alert] %>
+
+ <%= raw flash[:alert] %>
+
+ <% end %>
+ <%= yield %>
+
-
-
-
-
-
- 메뉴 2
-
-
-
-
-
-
-
- 메뉴 3
-
-
-
+ <% @controllers.each do |c| %>
+ <%= link_to view_schedule_path(c.id), class: "menu-group" do %>
+
-
-
-
- 메뉴 4
-
-
+
+
+
+ <%= c.name %>
+
+ <% end %>
+ <% end %>
diff --git a/app/views/schedules/index.html.erb b/app/views/schedules/index.html.erb
index 748fa05..408b2f4 100644
--- a/app/views/schedules/index.html.erb
+++ b/app/views/schedules/index.html.erb
@@ -1,7 +1 @@
-
-
+
- <% @controllers.each do |c| %>
- <%= link_to c.name, view_schedule_path(c.id), class: "btn bg-primary" %>
- <% end %>
-
-MAIN
diff --git a/app/views/schedules/schedule_edit.html.erb b/app/views/schedules/schedule_edit.html.erb
index abbf621..3fc392d 100644
--- a/app/views/schedules/schedule_edit.html.erb
+++ b/app/views/schedules/schedule_edit.html.erb
@@ -1,57 +1,58 @@
-<%= form_with url: schedule_edit_update_schedules_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-table-border' do %>
- <%= hidden_field_tag :controller_id, params[:id] %>
-
- <%= @controller.name %> 컨트롤러
-
-
-
+
| 시간 | -분 | -사용여부 | -온도 | -삭제 | -
|---|---|---|---|---|
| - <%= 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" %> - | -
+
\ No newline at end of file
diff --git a/app/views/schedules/view.html.erb b/app/views/schedules/view.html.erb
index 65675a8..8dd921d 100644
--- a/app/views/schedules/view.html.erb
+++ b/app/views/schedules/view.html.erb
@@ -1,28 +1,30 @@
-
+ <%= form_with url: schedule_edit_update_schedules_path, method: :post, class: 'flex flex-col h-full divide-y divide-border-base-border p-4' do %>
+ <%= hidden_field_tag :controller_id, params[:id] %>
+
-
-
+
+
+
+
+ <% end %>
+
+
+ <%= @controller.name %> 컨트롤러
+ <%= submit_tag "업데이트", class: "btn bg-primary" %>
+ | 시간 | +분 | +사용여부 | +온도 | +삭제 | +
|---|---|---|---|---|
| + <%= 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" %> + | +
+ <%= 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"
+ } %>
+
- <%= submit_tag "업데이트", class: "btn bg-primary" %>
-
-<% 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"
- } %>
-
+
-
- <%= @controller.name %> 컨트롤러
-
-
-
+
| 시간 | -분 | -사용여부 | -온도 | -
|---|
| <%= s.hour %>시 | -<%= s.minute %>분 | -<%= s.is_active %> | -<%= s.temperature %> °C | +시간 | +분 | +사용여부 | +온도 |
|---|
- <%= link_to "수정", schedule_edit_schedule_path(@controller.id), class: "btn bg-default-slate" %>
+
+
+ <% @schedule.each do |s| %>
+
+ <%= s.hour %>시
+ <%= s.minute %>분
+ <%= s.is_active %>
+ <%= s.temperature %> °C
+
+ <% end %>
+
+