Module: RateSortHelperPatch::InstanceMethods
- Defined in:
- lib/rate_sort_helper_patch.rb
Instance Method Summary collapse
-
#rate_sort_header_tag(column, options = {}) ⇒ Object
Allows more parameters than the standard sort_header_tag.
-
#rate_sort_link(column, caption, default_order, options = { }) ⇒ Object
Allows more parameters than the standard sort_link and is hard coded to use the RatesController and to have an :method and :update options.
Instance Method Details
#rate_sort_header_tag(column, options = {}) ⇒ Object
Allows more parameters than the standard sort_header_tag
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rate_sort_helper_patch.rb', line 8 def rate_sort_header_tag(column, = {}) caption = .delete(:caption) || titleize(Inflector::humanize(column)) default_order = .delete(:default_order) || 'asc' [:title]= l(:label_sort_by, "\"#{caption}\"") unless [:title] content_tag('th', rate_sort_link(column, caption, default_order, { :method => [:method], :update => [:update], :user_id => [:user_id] }), ) end |
#rate_sort_link(column, caption, default_order, options = { }) ⇒ Object
Allows more parameters than the standard sort_link and is hard coded to use the RatesController and to have an :method and :update options
22 23 24 25 26 27 28 29 |
# File 'lib/rate_sort_helper_patch.rb', line 22 def rate_sort_link(column, caption, default_order, = { }) # 0.8.x compatibility if SortHelper.const_defined? 'SortCriteria' rate_sort_link_trunk_version(column, caption, default_order, ) else rate_sort_link_08_version(column, caption, default_order, ) end end |