Skip to content

Commit 50dc031

Browse files
committed
WIP
1 parent 1abc785 commit 50dc031

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

app/models/appointment.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ class Appointment < ApplicationRecord
33

44
validates :requested_datetime, presence: true
55

6+
after_save_commit -> {
7+
broadcast_replace_to(
8+
"appointments_list",
9+
partial: "appointments/load_row",
10+
locals: { appointment: self }
11+
)
12+
}
13+
614
def created_by?(user)
715
created_by == user
816
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= turbo_frame_tag(appointment, src: row_appointment_path(appointment)) %>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= render "appointment", appointment: %>

config/routes.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Rails.application.routes.draw do
22
resource :session
33
resources :passwords, param: :token
4-
resources :appointments, only: [:index, :edit, :update]
4+
resources :appointments, only: [:index, :edit, :update] do
5+
member do
6+
get :row
7+
end
8+
end
59
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
610

711
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.

0 commit comments

Comments
 (0)