chronicles_controller.rb 368 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14

class ChroniclesController < ApplicationController

  before_filter :set_chronicle, :only => [:show]


  def show
  
  end

  protected

  def set_chronicle
    @chronicle = (Earning.all + Redemption.all).sort do |a,b|
15
      b.created_at <=> a.created_at
16
    end
17
18
19
20

    @chronicle = Kaminari.paginate_array(
      @chronicle
    ).page(params[:page]).per(20)
21
22
  end
end