Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add the launch button to ask without trigger.

  • Loading branch information...
commit ac4f668a20f73aeef1b5708ea9e9e4b89c9aaf1e 1 parent 76772a1
Willa authored
Showing with 8 additions and 2 deletions.
  1. +7 −0 lib/crowdring/crowdring.rb
  2. +1 −2  lib/views/campaign.haml
View
7 lib/crowdring/crowdring.rb
@@ -317,6 +317,13 @@ def process_request(service_name, request, response_type)
end
end
+ post '/campaign/:id/asks/:ask_id/trigger' do
+ campaign = Campaign.get(params[:id])
+ ask = campaign.asks.get(params[:ask_id])
+ ask.trigger(campaign.ringers, campaign.sms_number.raw_number)
+ end
+
+
post '/campaign/:id/destroy' do
campaign = Campaign.get(params[:id])
if campaign.destroy
View
3  lib/views/campaign.haml
@@ -50,8 +50,7 @@
%h2= "ASKS"
-@campaign.asks.each do |ask|
-if @campaign.asks.select{|n| n.triggered_ask && n.triggered_ask == ask}.empty?
- %form{action: "/campaign/#{@campaign.id}/broadcast", method: "post"}
- %input{type: 'hidden', name: 'message', value: "#{ask.message}"}
+ %form{action: "/campaign/#{@campaign.id}/asks/#{ask.id}/trigger", method: "post"}
%button{type:'submit'} Launch the Ask
=haml :ask, locals: {ask: ask, type: ask.class.typesym}
Please sign in to comment.
Something went wrong with that request. Please try again.