Class: NotificationSubscriptionsController

Inherits:
WhoopsController
  • Object
show all
Defined in:
app/controllers/notification_subscriptions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
# File 'app/controllers/notification_subscriptions_controller.rb', line 9

def create
  ns = Whoops::NotificationSubscription.create(params[:notification_subscription])
  ns.filter = Whoops::Filter.new_from_params(params[:whoops_filter])
  ns.filter.save
  redirect_to whoops_notification_subscriptions_path
end

#destroyObject



27
28
29
30
# File 'app/controllers/notification_subscriptions_controller.rb', line 27

def destroy
  Whoops::NotificationSubscription.find(params[:id]).destroy
  redirect_to whoops_notification_subscriptions_path
end

#editObject



16
17
18
# File 'app/controllers/notification_subscriptions_controller.rb', line 16

def edit
  @notification_subscription = Whoops::NotificationSubscription.find(params[:id])
end

#indexObject



2
3
4
5
6
7
# File 'app/controllers/notification_subscriptions_controller.rb', line 2

def index
  @notification_subscription = Whoops::NotificationSubscription.new
  @notification_subscription.build_filter
  @notification_subscriptions = Whoops::NotificationSubscription.asc(:email)
  @filter = Whoops::Filter.new
end

#updateObject



20
21
22
23
24
25
# File 'app/controllers/notification_subscriptions_controller.rb', line 20

def update
  @notification_subscription = Whoops::NotificationSubscription.find(params[:id])
  @notification_subscription.update_attributes(params[:notification_subscription])
  @notification_subscription.filter.update_from_params(params[:whoops_filter])
  redirect_to whoops_notification_subscriptions_path
end