Method: Binda::ComponentsHelper#get_sort_link_icon_by

Defined in:
app/helpers/binda/components_helper.rb

Get sort link icon by argument

This method returns a Font Awesome icon

Parameters:

  • arg (string)

    This should be the database column on which sort will be based

Returns:

  • (string)

    The icon which needs to be escaped with the html_safe method



95
96
97
98
99
100
101
102
103
104
# File 'app/helpers/binda/components_helper.rb', line 95

def get_sort_link_icon_by arg
	case 
	when params[:order].nil?
		'<i class="fas fa-sort-alpha-down"></i>'
	when params[:order][arg] == "DESC"
		'<i class="fas fa-sort-alpha-up"></i>'
	else
		'<i class="fas fa-sort-alpha-down"></i>'
	end
end