Method: Chaskiq::SubscribersController#destroy

Defined in:
app/controllers/chaskiq/subscribers_controller.rb

#destroyObject



51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/controllers/chaskiq/subscribers_controller.rb', line 51

def destroy
  find_subscriber
  begin
    if @subscription.unsubscribe!
      flash[:notice] = "Thanks, you will not receive more emails from this newsletter!"
      redirect_to campaign_path(@campaign)
    end
  rescue
    flash[:notice] = "Thanks, you will not receive more emails from this newsletter!"
    redirect_to campaign_path(@campaign)
  end
end