fix bug in sort_link helper around argument extraction about sort fields with block.

This commit is contained in:
smoriwaki 2017-07-28 21:42:17 +09:00
parent c9eff619dc
commit 49a485b7e3
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ module Ransack
unless Search === search
raise TypeError, 'First argument must be a Ransack::Search!'
end
args.unshift(capture(&block)) if block_given?
args[args.first.is_a?(Array) ? 1 : 0, 0] = capture(&block) if block_given?
s = SortLink.new(search, attribute, args, params, &block)
link_to(s.name, url(routing_proxy, s.url_options), s.html_options(args))
end