summaryrefslogtreecommitdiff
path: root/app/controllers/call_forwards_controller.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-25 11:41:55 -0500
committerPeter Kozak <spag@golwen.net>2013-02-25 11:41:55 -0500
commitfd07b7b85d2d40d7d2999c2899cc890eda2095fd (patch)
treebf4fbb797d4b645fbe4752a253297a09de466953 /app/controllers/call_forwards_controller.rb
parent0442cd19bc9383669b506185356227361a16e442 (diff)
more polymorphic objects
Diffstat (limited to 'app/controllers/call_forwards_controller.rb')
-rw-r--r--app/controllers/call_forwards_controller.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/call_forwards_controller.rb b/app/controllers/call_forwards_controller.rb
index cd72a38..34fb77a 100644
--- a/app/controllers/call_forwards_controller.rb
+++ b/app/controllers/call_forwards_controller.rb
@@ -48,8 +48,8 @@ class CallForwardsController < ApplicationController
@call_forward = @parent.call_forwards.build( params[:call_forward] )
if @call_forward.save
- m = method( :"#{@parent.class.name.underscore}_call_forward_path" )
- redirect_to m.( @parent, @call_forward ), :notice => t('call_forwards.controller.successfuly_created')
+ m = method( :"#{@parent.class.name.underscore}_call_forwards_url" )
+ redirect_to m.( @parent ), :notice => t('call_forwards.controller.successfuly_created')
else
@available_call_forward_cases = CallForwardCase.all
render :new
@@ -64,8 +64,8 @@ class CallForwardsController < ApplicationController
def update
@available_call_forward_cases = CallForwardCase.all
if @call_forward.update_attributes(params[:call_forward])
- m = method( :"#{@parent.class.name.underscore}_call_forward_path" )
- redirect_to m.( @parent, @call_forward ), :notice => t('call_forwards.controller.successfuly_updated')
+ m = method( :"#{@parent.class.name.underscore}_call_forwards_url" )
+ redirect_to m.( @parent ), :notice => t('call_forwards.controller.successfuly_updated')
else
@call_forwarding_destinations = call_forwarding_destination_types()
render :edit
@@ -74,7 +74,8 @@ class CallForwardsController < ApplicationController
def destroy
@call_forward.destroy
- redirect_to :root, :notice => t('call_forwards.controller.successfuly_destroyed')
+ m = method( :"#{@parent.class.name.underscore}_call_forwards_url" )
+ redirect_to m.( @parent ), :notice => t('call_forwards.controller.successfuly_destroyed')
end
private
@@ -110,7 +111,8 @@ class CallForwardsController < ApplicationController
add_breadcrumb @sip_account, tenant_sip_account_path(@tenant, @sip_account)
end
- add_breadcrumb t("call_forwards.index.page_title"), phone_number_call_forwards_path(@parent)
+ m = method( :"#{@parent.class.name.underscore}_call_forwards_url" )
+ add_breadcrumb t("call_forwards.index.page_title"), m.(@parent)
if @call_forward && !@call_forward.new_record?
m = method( :"#{@parent.class.name.underscore}_call_forward_path" )
add_breadcrumb @call_forward, m.(@parent, @call_forward)