Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

paginated journals

  • Loading branch information...
commit 9ff8a1e1938f80232bff82e88cf87ce15faa89c4 1 parent f4febba
authored August 03, 2011
5  app/views/journals/_list_account.html.haml
... ...
@@ -1,3 +1,5 @@
  1
+- @journals = Journal.all("postings.account_id" => @account.id, :order => [:date.desc]).paginate(:page => params[:page], :per_page => 25)
  2
+= paginate @journals
1 3
 %table.narrow.form
2 4
   %tr
3 5
     %th
@@ -11,7 +13,7 @@
11 13
     %th{:colspan => 2}
12 14
       Account Credit
13 15
   - counter = 0
14  
-  - Journal.all("postings.account_id" => @account.id, :limit => 25, :order => [:date.desc]).each do |journal|
  16
+  - @journals.each do |journal|
15 17
     - postings = journal.postings.group_by{|x| x.amount>0 ? :credit : :debit}
16 18
     - time_format = Mfi.first.date_format || "%d-%m-%Y"
17 19
     - time_format += " %H:%M"
@@ -40,3 +42,4 @@
40 42
         %td
41 43
           = p.amount.to_account_balance
42 44
    
  45
+= paginate @journals

0 notes on commit 9ff8a1e

Please sign in to comment.
Something went wrong with that request. Please try again.