From 6caae0231c11ad89c1eeed3b0f8db8dfcb88c729 Mon Sep 17 00:00:00 2001 From: Riley Lynch Date: Sat, 6 Oct 2012 16:58:27 -0400 Subject: Accept :remote as symbol in link_to options Accept either :remote or 'remote' in both the html_options and (url_)options hash arguments to link_to. --- actionpack/lib/action_view/helpers/url_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/helpers/url_helper.rb') diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 3f65791aa0..e8b3b14265 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -175,9 +175,10 @@ module ActionView def link_to(name = nil, options = nil, html_options = nil, &block) html_options, options = options, name if block_given? options ||= {} - url = url_for(options) html_options = convert_options_to_data_attributes(options, html_options) + + url = url_for(options) html_options['href'] ||= url content_tag(:a, name || url, html_options, &block) @@ -598,7 +599,9 @@ module ActionView end def link_to_remote_options?(options) - options.is_a?(Hash) && options.delete('remote') + if options.is_a?(Hash) + options.delete('remote') || options.delete(:remote) + end end def add_method_to_attributes!(html_options, method) -- cgit v1.2.3