Class: MailgunListManager::ListsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mailgun_list_manager/lists_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
# File 'app/controllers/mailgun_list_manager/lists_controller.rb', line 10

def create
  List.add(list_params[:address], list_params)
  @lists = List.all
end

#destroyObject



21
22
23
24
# File 'app/controllers/mailgun_list_manager/lists_controller.rb', line 21

def destroy
  List.destroy(params[:id])
  @lists = List.all
end

#indexObject



6
7
8
# File 'app/controllers/mailgun_list_manager/lists_controller.rb', line 6

def index
  @lists = List.all
end

#updateObject



15
16
17
18
19
# File 'app/controllers/mailgun_list_manager/lists_controller.rb', line 15

def update
  list = List.find(params[:id])
  @list = list.update(list_params)
  @old_id = params[:id]
end