Fix sorting in members/index
This commit is contained in:
parent
d6bd26c76f
commit
066bf32e0c
@ -2,14 +2,15 @@ module MembersHelper
|
|||||||
def link_to_current_with_sort text, default_sort
|
def link_to_current_with_sort text, default_sort
|
||||||
current_sort = stringify(sort_params)
|
current_sort = stringify(sort_params)
|
||||||
|
|
||||||
pp [default_sort, current_sort]
|
current_params = request.params.except(:action, :controller)
|
||||||
|
|
||||||
if default_sort == current_sort
|
if default_sort == current_sort
|
||||||
link_to text, members_path(sort: invert_sort_order(current_sort))
|
current_params.merge!(sort: invert_sort_order(current_sort))
|
||||||
else
|
else
|
||||||
link_to text, members_path(sort: default_sort)
|
current_params.merge!(sort: default_sort)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
link_to text, members_path(current_params)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Loading…
Reference in New Issue
Block a user