Basic deliverable table implemented. #1135

This commit is contained in:
Eric Davis
2008-05-20 19:48:15 -07:00
parent 67dc53bdca
commit f99883c1bd
6 changed files with 78 additions and 4 deletions
+17 -1
View File
@@ -3,8 +3,24 @@ class DeliverablesController < ApplicationController
layout 'base'
before_filter :find_project, :authorize, :get_settings
helper :sort
include SortHelper
def index
@deliverables = Deliverable.find_all_by_project_id(@project.id)
sort_init "#{Deliverable.table_name}.id", "desc"
sort_update
limit = per_page_option
@deliverable_count = Deliverable.count(:conditions => { :project_id => @project.id })
@deliverable_pages = Paginator.new self, @deliverable_count, limit, params['page']
@deliverables = Deliverable.find(:all,
:order => sort_clause,
:conditions => { :project_id => @project.id },
:limit => limit,
:offset => @deliverable_pages.current.offset)
respond_to do |format|
format.html { render :action => 'index', :layout => !request.xhr? }
end
end
private