contacts page refactoring

This commit is contained in:
Eugene Korbut 2009-02-09 01:00:26 +10:00
parent e7d134fa28
commit 155c766a29
11 changed files with 45 additions and 47 deletions

View file

@ -1,11 +1,7 @@
class ContactController < ApplicationController
class ContactsController < ApplicationController
layout :select_layout
def index
redirect_to(:action =>"list")
end
def list
@contact_pages = Paginator.new(self, Contact.count("customer_id = #{logged_user}"), CDF::CONFIG[:contacts_per_page], params['page'])
@contacts = Contact.find(:all, :conditions=>["customer_id = #{logged_user}"], :order=>['fname'], :limit=>CDF::CONFIG[:contacts_per_page], :offset=>@contact_pages.current.offset)