Open tanelj opened 14 years ago
Order helper doesn't work with symbols in case of ascend_scope/descend_scope. User can't sort descending.
Does not work: <%= order @search, :ascend_scope => :sort_by_report_total_amount_asc, :descend_scope => :sort_by_report_total_amount_desc %>
Works: <%= order @search, :ascend_scope => 'sort_by_report_total_amount_asc', :descend_scope => 'sort_by_report_total_amount_desc' %>
It seems like line in rails.helper.rb Line 30: ascending = search.order.to_s == options[:ascend_scope]
Should be: Line 30: ascending = search.order.to_s == options[:ascend_scope].to_s
Order helper doesn't work with symbols in case of ascend_scope/descend_scope. User can't sort descending.
Does not work: <%= order @search, :ascend_scope => :sort_by_report_total_amount_asc, :descend_scope => :sort_by_report_total_amount_desc %>
Works: <%= order @search, :ascend_scope => 'sort_by_report_total_amount_asc', :descend_scope => 'sort_by_report_total_amount_desc' %>
It seems like line in rails.helper.rb Line 30: ascending = search.order.to_s == options[:ascend_scope]
Should be: Line 30: ascending = search.order.to_s == options[:ascend_scope].to_s