Class: Nuntius::Admin::ListsController

Inherits:
Nuntius::ApplicationAdminController show all
Defined in:
app/controllers/nuntius/admin/lists_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 17

def create
  @list = Nuntius::List.create(list_params)
  respond_with :admin, @list
end

#editObject



26
27
28
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 26

def edit
  @list = Nuntius::List.visible.find(params[:id])
end

#indexObject



8
9
10
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 8

def index
  @lists = Nuntius::List.visible.order(:name)
end

#newObject



12
13
14
15
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 12

def new
  @list = Nuntius::List.new
  render :edit
end

#showObject



22
23
24
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 22

def show
  redirect_to :edit_admin_list, status: :see_other
end

#updateObject



30
31
32
33
34
# File 'app/controllers/nuntius/admin/lists_controller.rb', line 30

def update
  @list = Nuntius::List.visible.find(params[:id])
  @list.update(list_params)
  respond_with :admin, @list
end