From 6bf3b1aa4b98641540a55eb800bd6391756aaf51 Mon Sep 17 00:00:00 2001 From: Matthew Wean Date: Sun, 18 Sep 2011 19:17:03 -0400 Subject: [PATCH] Added indicator_spacer to sort_link helper So we can use a   to the sorting indicator from breaking to a new line --- lib/meta_search/helpers/url_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/meta_search/helpers/url_helper.rb b/lib/meta_search/helpers/url_helper.rb index 82d3d46..f4b6996 100644 --- a/lib/meta_search/helpers/url_helper.rb +++ b/lib/meta_search/helpers/url_helper.rb @@ -37,6 +37,9 @@ def sort_link(builder, attribute, *args) end options.delete(:default_order) + indicator_spacer = options[:indicator_spacer] || ' ' + options.delete(:indicator_spacer) + html_options = args.first.is_a?(Hash) ? args.shift : {} css = ['sort_link', current_order].compact.join(' ') html_options[:class] = [css, html_options[:class]].compact.join(' ') @@ -45,7 +48,7 @@ def sort_link(builder, attribute, *args) 'meta_sort' => [attr_name, new_order].join('.') ) ) - link_to [ERB::Util.h(name), order_indicator_for(current_order)].compact.join(' ').html_safe, + link_to [ERB::Util.h(name), order_indicator_for(current_order)].compact.join(indicator_spacer)).html_safe, url_for(options), html_options end