From 2f29dead22ab6d44300e3259f610f0dcd546b69a Mon Sep 17 00:00:00 2001 From: DreamVenerable <114648602+DreamVenerable@users.noreply.github.com> Date: Fri, 29 Dec 2023 00:47:15 +0200 Subject: [PATCH] toggle for complete tasks --- app/models/task.rb | 2 ++ app/views/organizations/pets/tasks/_tasks.html.erb | 11 +++++++---- .../organizations/pets/tasks/_tasks_toggle.html.erb | 11 +++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 app/views/organizations/pets/tasks/_tasks_toggle.html.erb diff --git a/app/models/task.rb b/app/models/task.rb index c22525029..e399fc72c 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -23,4 +23,6 @@ class Task < ApplicationRecord validates :name, presence: true validates :description, presence: true + + default_scope { order(created_at: :asc) } end diff --git a/app/views/organizations/pets/tasks/_tasks.html.erb b/app/views/organizations/pets/tasks/_tasks.html.erb index 21679f82c..aac2df8db 100644 --- a/app/views/organizations/pets/tasks/_tasks.html.erb +++ b/app/views/organizations/pets/tasks/_tasks.html.erb @@ -14,15 +14,18 @@
<%= task.description %>
+ +<%= task.description %>
+