class NotificationsController < ApplicationController before_action :require_login before_action :set_notification, only: [:deliver] # GET /notifications def index @notifications = Notification.order(to_be_sent_on: :asc) end # POST /notifications/1/deliver def deliver @notification.deliver! redirect_to @notification.member end private # Use callbacks to share common setup or constraints between actions. def set_notification @notification = Notification.find(params[:id]) end end