Class: IshManager::EmailCampaignLeadsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IshManager::EmailCampaignLeadsController
- Defined in:
- app/controllers/ish_manager/email_campaign_leads_controller.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#show ⇒ Object
def new @new_lead = ::Lead.new authorize! :new, @new_lead end.
Methods inherited from ApplicationController
Instance Method Details
permalink #destroy ⇒ Object
def create
@lead = ::Lead.new params[:lead].permit!
:create, @lead
if @lead.save
flash[:notice] = "created lead"
else
flash[:alert] = "Cannot create lead: #{@lead.errors.}"
end
redirect_to :action => 'index'
end
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/ish_manager/email_campaign_leads_controller.rb', line 36 def destroy @clead = EmailCampaignLead.find params[:id] :destroy, @clead flag = @clead.delete if flag flash[:notice] = 'ok' else flash[:alert] = 'no luck' end redirect_to controller: 'email_campaigns', action: :show, id: @clead.email_campaign_id end |
permalink #show ⇒ Object
def new
@new_lead = ::Lead.new
:new, @new_lead
end
58 59 60 61 62 |
# File 'app/controllers/ish_manager/email_campaign_leads_controller.rb', line 58 def show @c_lead = ::EmailCampaignLead.find params[:id] :show, @c_lead end |