Class: Golden::Menu::HierarchicalMenusController

Inherits:
ApplicationController
  • Object
show all
Includes:
TheSortableTreeController::Rebuild
Defined in:
app/controllers/golden/menu/hierarchical_menus_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



24
25
26
27
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 24

def create
  @menu.save
  respond_with @menu
end

#destroyObject



34
35
36
37
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 34

def destroy
  @menu.destroy
  respond_with @menu
end

#editObject



21
22
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 21

def edit
end

#indexObject



8
9
10
11
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 8

def index
  @menu = @menus.nested_set.select('id, url, name, description, parent_id')
  respond_with @menus
end

#listObject



39
40
41
42
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 39

def list
  @menu = @menus.nested_set
  @menus = @menus.paginate page: params[:page]
end

#newObject



17
18
19
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 17

def new
  respond_with @menu
end

#showObject



13
14
15
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 13

def show
  respond_with @menu
end

#updateObject



29
30
31
32
# File 'app/controllers/golden/menu/hierarchical_menus_controller.rb', line 29

def update
  @menu.update_attributes menu_params
  respond_with @menu
end