diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index bfbe148..c3a16f8 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,6 +1,12 @@ class NotificationsController < ApplicationController before_action :require_login - before_action :set_notification + before_action :set_notification, only: [:deliver] + + # GET /notifications + def index + @scheduled = Notification.where(status: 'scheduled').order(to_be_sent_on: :asc) + @sent = Notification.where(status: 'sent').order(sent_at: :desc) + end # POST /notifications/1/deliver def deliver diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5bb562a..4636d6a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,6 +16,7 @@