Permalink
Browse files

Fix removing voice number route

  • Loading branch information...
1 parent fe36367 commit 5b80e12186df41e98be7c341e37d5ea325fc031a Willa committed Nov 7, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −3 lib/crowdring/crowdring.rb
  2. +1 −1 lib/views/voice_numbers.haml
@@ -224,10 +224,10 @@ def process_request(service_name, request, response_type)
haml :tag_new
end
- post '/campaign/:id/update' do
+ post '/campaign/:id/assigned_voice_number/destroy' do
campaign = Campaign.get(params[:id])
- campaign.voice_numbers.get(params[:voice_number]).destroy
- flash[:notice] = "Voice number has been removed"
+ campaign.voice_numbers.get(params[:voice_number]).destroy
+ flash[:notice] = "Voice number has been removed"
redirect to("/campaigns##{campaign.id}")
end
@@ -6,6 +6,6 @@
-else
-voice_numbers.each do |voice_number|
%h4= "Phone Number: #{voice_number.pretty_phone_number}, Description: #{voice_number.description}"
- %form{action: "/campaign/#{campaign.id}/update", method: 'post'}
+ %form{action: "/campaign/#{campaign.id}/assigned_voice_number/destroy", method: 'post'}
%input{type: 'hidden', name: 'voice_number', value: "#{voice_number.phone_number}"}
%button{type: 'submit'} Remove

0 comments on commit 5b80e12

Please sign in to comment.