mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
21 lines
562 B
Ruby
21 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
|