Class: Campagne::CampagneCampaignsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Campagne::CampagneCampaignsController
- Defined in:
- app/controllers/campagne/campagne_campaigns_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #deliveries ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #preview ⇒ Object
- #schedule ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 20 def create @campaign = CampagneCampaign.new(params[:campagne_campagne_campaign]) flash[:notice] = 'Campaign was successfully created.' if @campaign.save respond_with(@campaign, :location => campagne_campagne_campaigns_path) end |
#deliveries ⇒ Object
42 43 44 45 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 42 def deliveries @campaign = CampagneCampaign.find(params[:id]) @deliveries = @campaign.campagne_deliveries end |
#edit ⇒ Object
26 27 28 29 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 26 def edit @campaign = CampagneCampaign.find(params[:id]) respond_with(@campaign) end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 6 def index @campaigns = CampagneCampaign.all end |
#new ⇒ Object
15 16 17 18 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 15 def new @campaign = CampagneCampaign.new respond_with(@campaign) end |
#preview ⇒ Object
37 38 39 40 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 37 def preview @campaign = CampagneCampaign.find(params[:id]) render :layout => nil end |
#schedule ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 47 def schedule @campaign = CampagneCampaign.find(params[:id]) datetime = Time.zone.local( params[:schedule][:"at(1i)"].to_i, params[:schedule][:"at(2i)"].to_i, params[:schedule][:"at(3i)"].to_i, params[:schedule][:"at(4i)"].to_i, params[:schedule][:"at(5i)"].to_i ) Resque.enqueue_at(datetime, Campagne::SenderJob, @campaign.id) redirect_to campagne_campagne_campaign_path(@campaign), :notice => 'Campaign was successfully scheduled.' end |
#show ⇒ Object
10 11 12 13 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 10 def show @campaign = CampagneCampaign.find(params[:id]) respond_with(@campaign) end |
#update ⇒ Object
31 32 33 34 35 |
# File 'app/controllers/campagne/campagne_campaigns_controller.rb', line 31 def update @campaign = CampagneCampaign.find(params[:id]) flash[:notice] = 'Campaign was successfully updated.' if @campaign.update_attributes(params[:campagne_campagne_campaign]) respond_with(@campaign) end |