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:
Eric Davis
2009-01-19 15:00:43 -08:00
parent f870a6019e
commit 05dd3649f6
3 changed files with 6 additions and 7 deletions

View File

@@ -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)

View File

@@ -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>

View File

@@ -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>