From 2ad8dc6a1f805315d4a1173fe988e15098c59364 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 13 Apr 2005 05:21:37 +0000 Subject: Added :confirm option to link_to_remote just like link_to has #1082 [yrashk@fp.org.ua] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/javascript_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/javascript_helper.rb') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index ba418b15b3..584f33f81d 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -106,7 +106,8 @@ module ActionView function = "#{options[:before]}; #{function}" if options[:before] function = "#{function}; #{options[:after]}" if options[:after] function = "if (#{options[:condition]}) { #{function}; }" if options[:condition] - + function = "if (confirm('#{escape_javascript(options[:confirm])}')) { #{function}; }" if options[:confirm] + return function end -- cgit v1.2.3