Class: Notifiable::NotificationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Notifiable::NotificationsController
- Defined in:
- app/controllers/notifiable/notifications_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/notifiable/notifications_controller.rb', line 10 def create @notification = Notification.new(params[:notifiable_notification]) if @notification.valid? @subscriber.save end end |
#dismiss ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/notifiable/notifications_controller.rb', line 17 def dismiss notification = Notification.find(params[:id]) notification.update_attribute('dismissed', true) respond_to do |format| format.js { render :update do |page| page.remove "system_message_#{notification.id}" end } end end |
#new ⇒ Object
6 7 8 |
# File 'app/controllers/notifiable/notifications_controller.rb', line 6 def new @notification = Notification.new end |