Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
6  lib/crowdring/crowdring.rb
@@ -141,8 +141,8 @@ def process_request(service_name, request, response_type)
141 141
       end
142 142
     end
143 143
 
144  
-    post '/unsubscribe_numbers/:id/:phone_number/destroy' do
145  
-      unsubscribe_number = AssignedUnsubscribeVoiceNumber.get(params[:id], params[:phone_number])
  144
+    post '/unsubscribe_numbers/:id/destroy' do
  145
+      unsubscribe_number = AssignedUnsubscribeVoiceNumber.first(id: params[:id])
146 146
       if unsubscribe_number.destroy
147 147
         flash[:notice] = "Unsubscribe number removed"
148 148
       else
@@ -333,7 +333,7 @@ def process_request(service_name, request, response_type)
333 333
     post '/campaign/:id/assigned_voice_number/destroy' do
334 334
       campaign = Campaign.get(params[:id])
335 335
       unless campaign.voice_numbers.count == 1
336  
-        campaign.voice_numbers.get(params[:voice_number]).destroy
  336
+        campaign.voice_numbers.first(id: params[:number_id]).destroy
337 337
         flash[:notice] = "Voice number has been removed"
338 338
         redirect to("/campaigns##{campaign.id}")
339 339
       else
2  lib/views/unsubscribe_number.haml
... ...
@@ -1,4 +1,4 @@
1 1
 %h4 #{number.pretty_phone_number}
2  
-%form{action: "/unsubscribe_numbers/#{number.id}/#{number.phone_number}/destroy", method: 'post'}
  2
+%form{action: "/unsubscribe_numbers/#{number.id}/destroy", method: 'post'}
3 3
   %button{type: 'submit'} Remove
4 4
   
3  lib/views/voice_numbers.haml
@@ -7,6 +7,5 @@
7 7
     -voice_numbers.each do |voice_number|
8 8
       %h4= "Phone Number: #{voice_number.pretty_phone_number}, Description: #{voice_number.description}"
9 9
       %form{action: "/campaign/#{campaign.id}/assigned_voice_number/destroy", method: 'post'}
10  
-        %input{type: 'hidden', name: 'phone_nubmer', value: "#{voice_number.phone_number}"}
11  
-        %input{type: 'hidden', name: 'voice_number[id]', value: "#{voice_number.id}"}
  10
+        %input{type: 'hidden', name: 'number_id', value: "#{voice_number.id}"}
12 11
         %button{type: 'submit'} Remove

No commit comments for this range

Something went wrong with that request. Please try again.