Class: NotificationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



23
24
25
# File 'app/controllers/notifications_controller.rb', line 23

def create

end

#destroyObject



44
45
46
47
# File 'app/controllers/notifications_controller.rb', line 44

def destroy
  @notification.receipt_for(@actor).move_to_trash
  redirect_to notifications_path
end

#editObject



19
20
21
# File 'app/controllers/notifications_controller.rb', line 19

def edit

end

#indexObject



7
8
9
# File 'app/controllers/notifications_controller.rb', line 7

def index
  @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10)
end

#newObject



15
16
17
# File 'app/controllers/notifications_controller.rb', line 15

def new

end

#showObject



11
12
13
# File 'app/controllers/notifications_controller.rb', line 11

def show
  
end

#updateObject



27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/notifications_controller.rb', line 27

def update
  if params[:read].present?
    if params[:read].eql?("Read")
      @actor.read @notification
    elsif params[:read].eql?("Unread")
      @actor.unread @notification
    end
  end
  redirect_to notifications_path(:page => params[:page])
end

#update_allObject



38
39
40
41
42
# File 'app/controllers/notifications_controller.rb', line 38

def update_all
  @notifications= @mailbox.notifications.all
  @actor.read @notifications
  redirect_to notifications_path(:page => params[:page])
end