53ebb509d8
Then make the turbo response to clearing all notifications a no-op. This has the bonus side effect of properly clearing the notifications try on all open pages. ref: https://fizzy.37signals.com/5986089/collections/2/cards/796
15 lines
418 B
Ruby
15 lines
418 B
Ruby
class Notifications::ReadingsController < ApplicationController
|
|
def create
|
|
@notification = Current.user.notifications.find(params[:id])
|
|
@notification.read
|
|
end
|
|
|
|
def create_all
|
|
Current.user.notifications.unread.read_all
|
|
respond_to do |format|
|
|
format.html { redirect_to notifications_path }
|
|
format.turbo_stream { } # No action needed, readings will have been broadcast
|
|
end
|
|
end
|
|
end
|