Class: Mycommands::CategoryController

Inherits:
Controller
  • Object
show all
Defined in:
lib/mycommands/controllers/category_controller.rb

Instance Method Summary collapse

Methods inherited from Controller

#initialize, #render

Constructor Details

This class inherits a constructor from Mycommands::Controller

Instance Method Details

#index(choice = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/mycommands/controllers/category_controller.rb', line 3

def index choice = nil
  if choice == '0'
    @model.go_back
  elsif !choice.nil?
    @model.choose choice
  end
  @categories = @model.categories
  render if @categories
  Factory::get(:CommandController).index(@model.category)
end