Fixed the sorts by updated to 0.8 to use the new sort API and fixing the update element id. #1915
This commit is contained in:
@@ -11,7 +11,7 @@ class RatesController < ApplicationController
|
||||
# GET /rates.xml?user_id=1
|
||||
def index
|
||||
sort_init "#{Rate.table_name}.date_in_effect", "desc"
|
||||
sort_update # 'date_in_effect' => "#{Rate.table_name}.date_in_effect"
|
||||
sort_update ['date_in_effect', 'project_id']
|
||||
|
||||
@rates = Rate.history_for_user(@user, sort_clause)
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
:default_order => 'desc',
|
||||
:style => "width: 15%",
|
||||
:method => :get,
|
||||
:update => "rate-history",
|
||||
:update => "rate_history",
|
||||
:user_id => @user.id) %>
|
||||
<%= rate_sort_header_tag("project_id",
|
||||
:caption => l(:label_project),
|
||||
:default_order => 'asc',
|
||||
:method => :get,
|
||||
:update => "rate-history",
|
||||
:update => "rate_history",
|
||||
:user_id => @user.id) %>
|
||||
<th style="width:15%"><%= l(:rate_label_rate) %></th>
|
||||
<th style="width:5%"></th>
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
<h1><%= l(:rate_label_rate_history) %></h1>
|
||||
<%# TODO: Refactor out of the view once there is a hook in the controller (Post 0.8.0). %>
|
||||
<%# Can't expect everyone to upgrade at the moment %>
|
||||
<% sort_init "#{Rate.table_name}.date_in_effect", "desc" %>
|
||||
<% sort_update # 'date_in_effect' => "#{Rate.table_name}.date_in_effect" %>
|
||||
|
||||
<% sort_init "#{Rate.table_name}.date_in_effect", "desc" %>
|
||||
<% sort_update ['date_in_effect', 'project_id'] %>
|
||||
|
||||
<% @rates = Rate.history_for_user(@user, "#{Rate.table_name}.date_in_effect desc") %>
|
||||
|
||||
<%= render :partial => 'rates/list' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user