mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-30 22:41:33 +00:00
22 lines
562 B
Ruby
22 lines
562 B
Ruby
|
module UsersHelper
|
||
|
def sort_link text, param
|
||
|
key = param
|
||
|
key += "_reverse" if params[:sort] == param
|
||
|
|
||
|
options = {
|
||
|
:url => {:params => params.merge({:sort => key, :page => nil})},
|
||
|
:with => "`_method=get`",
|
||
|
:update => 'usersTable',
|
||
|
:before => "Element.show('spinner')",
|
||
|
:success => "Element.hide('spinner')",
|
||
|
}
|
||
|
|
||
|
html_options = {
|
||
|
:title => "Sort by this field",
|
||
|
:href => url_for(:params => params.merge({:sort => key, :page => nil})),
|
||
|
}
|
||
|
|
||
|
# link_to_remote text, options, html_options
|
||
|
end
|
||
|
end
|