Class: UserNotif::NotifsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/user_notif/install_templates/notifs_controller.rb

Instance Method Summary collapse

Instance Method Details

#readObject

Raises:

  • (ActiveRecord::RecordNotFound)


6
7
8
9
10
11
# File 'lib/generators/user_notif/install_templates/notifs_controller.rb', line 6

def read
  set_notif
  raise ActiveRecord::RecordNotFound, 'Not Found' unless @notif
  @notif.update!(unread: false)
  head :ok
end