~egoday/+junk/ftpbox

« back to all changes in this revision

Viewing changes to app/helpers/attachments_helper.rb

  • Committer: Emiliano Goday Caneda
  • Date: 2008-10-15 07:48:22 UTC
  • Revision ID: egoday@gmail.com-20081015074822-j8bn7j01fj7zf2gb
Inicial 2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
module AttachmentsHelper
 
2
  
 
3
  def sort_td_class_helper(param)
 
4
    result = 'class="sortup"' if params[:sort] == param
 
5
    result = 'class="sortdown"' if params[:sort] == param + " DESC"
 
6
    return result
 
7
  end
 
8
 
 
9
  def sort_link_helper(text, param)
 
10
    key = param
 
11
    key += " DESC" if params[:sort] == param
 
12
    options = {
 
13
      :url => {:action => 'index', :params => params.merge({:sort => key, :page => nil})}
 
14
    }
 
15
    html_options = {
 
16
      :title => "Sort by this field",
 
17
      :href => url_for(:action => 'index', :params => params.merge({:sort => key, :page => nil}))
 
18
    }
 
19
    link_to_remote(text, options, html_options)
 
20
  end
 
21
end
 
 
b'\\ No newline at end of file'