Files
once-campfire/app/controllers/users/push_subscriptions/test_notifications_controller.rb
Kevin McConnell df76a227dc Hello world
First open source release of Campfire 🎉
2025-08-21 09:31:59 +01:00

14 lines
457 B
Ruby

class Users::PushSubscriptions::TestNotificationsController < ApplicationController
before_action :set_push_subscription
def create
@push_subscription.notification(title: "Campfire Test", body: Random.uuid, path: user_push_subscriptions_url).deliver
redirect_to user_push_subscriptions_url
end
private
def set_push_subscription
@push_subscription = Current.user.push_subscriptions.find(params[:push_subscription_id])
end
end