Class: LogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/logs_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modeObject (readonly)

Returns the value of attribute mode.



20
21
22
# File 'app/controllers/logs_controller.rb', line 20

def mode
  @mode
end

Instance Method Details

#viewObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/logs_controller.rb', line 3

def view
  # param
  @mode = params[:mode]
  @year, @month = params[:year].to_i, params[:month].to_i

  # date
  @current_month = Date.new(@year, @month)
  @month_range = @current_month .. ((@current_month >> 1) - 1)

  # items
  @accounts = .all(:order => "position")
  @categories = Category.hashed
  @cat_all = [
    @categories[:expense],
    @categories[:income],
  ].flatten(1)
end