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



46
47
48
49
50
# File 'app/controllers/notifications_controller.rb', line 46

def destroy
  @notification.receipt_for(@actor).move_to_trash
  @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10)
  render :action => :index
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
37
# 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
  @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10)
  render :action => :index
end

#update_allObject



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

def update_all
  @notifications= @mailbox.notifications.all
  @actor.read @notifications
  @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10)
  render :action => :index
end