Class: NotificationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- NotificationsController
- Defined in:
- app/controllers/notifications_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
- #update_all ⇒ Object
Instance Method Details
#create ⇒ Object
23 24 25 |
# File 'app/controllers/notifications_controller.rb', line 23 def create end |
#destroy ⇒ Object
50 51 52 53 54 |
# File 'app/controllers/notifications_controller.rb', line 50 def destroy @notification.receipt_for(@actor).move_to_trash @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10) render :action => :index end |
#edit ⇒ Object
19 20 21 |
# File 'app/controllers/notifications_controller.rb', line 19 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/notifications_controller.rb', line 7 def index @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10) end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/notifications_controller.rb', line 15 def new end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/notifications_controller.rb', line 11 def show end |
#update ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/notifications_controller.rb', line 27 def update if params[:read].present? if params[:read].eql?("Read") @actor.mark_as_read @notification elsif params[:read].eql?("Unread") @actor.mark_as_unread @notification end end @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10) render :action => :index end |
#update_all ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/notifications_controller.rb', line 39 def update_all @notifications= @mailbox.notifications.all @actor.mark_as_read @notifications if request.xhr? render text: '' else redirect_to notifications_path end end |