mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
add sorting to contact domains
This commit is contained in:
parent
50983cd95d
commit
5dc550172d
3 changed files with 33 additions and 10 deletions
|
@ -55,4 +55,16 @@ module ApplicationHelper
|
|||
username ||= ''
|
||||
username.split(':').last.to_s.strip
|
||||
end
|
||||
|
||||
def custom_sort_link(title, param_name)
|
||||
sort = params.fetch(:sort, {})[param_name]
|
||||
order = {"asc"=>"desc", "desc"=>"asc"}[sort] || "asc"
|
||||
|
||||
# binding.pry
|
||||
if params.fetch(:sort, {}).include?(param_name)
|
||||
title += (sort == "asc" ? " ▲" : " ▼")
|
||||
end
|
||||
|
||||
link_to(title, url_for(sort: {param_name => order}), class: "sort_link #{order}")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue