Class: Nuntius::Admin::Lists::SubscribersController

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

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
24
25
# File 'app/controllers/nuntius/admin/lists/subscribers_controller.rb', line 20

def create
  @subscriber = @list.subscribers.new(subscriber_params)
  @subscriber.save
  # FIXME: This should redirect to list
  respond_with :admin, :list, @subscriber, collection_location: -> { nuntius.admin_list_url(@list) }, location: -> { nuntius.admin_list_url(@list) }, status: :see_other
end

#editObject



27
28
29
# File 'app/controllers/nuntius/admin/lists/subscribers_controller.rb', line 27

def edit
  @subscriber = @list.subscribers.find(params[:id])
end

#indexObject



11
12
13
# File 'app/controllers/nuntius/admin/lists/subscribers_controller.rb', line 11

def index
  @subscribers = @list.subscribers.all
end

#newObject



15
16
17
18
# File 'app/controllers/nuntius/admin/lists/subscribers_controller.rb', line 15

def new
  @subscriber = @list.subscribers.new
  render :edit
end

#updateObject



31
32
33
34
35
36
# File 'app/controllers/nuntius/admin/lists/subscribers_controller.rb', line 31

def update
  @subscriber = @list.subscribers.find(params[:id])
  @subscriber.update(subscriber_params)
  # FIXME: This should redirect to list
  respond_with :admin, :list, @subscriber, collection_location: -> { nuntius.admin_list_url(@list) }, location: -> { nuntius.admin_list_url(@list) }, status: :see_other
end