Class: Admin::MenusController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/menus_controller.rb

Instance Method Summary collapse

Instance Method Details

#activateObject



59
60
61
# File 'app/controllers/admin/menus_controller.rb', line 59

def activate
  render :text => @menu.activate
end

#createObject



27
28
29
30
31
32
33
34
35
# File 'app/controllers/admin/menus_controller.rb', line 27

def create
  if @menu.save
    flash[:notice] = t('menu.create.success').capitalize
    redirect_to([forgeos_cms, :edit, :admin, @menu])
  else
    flash[:error] = t('menu.create.failed').capitalize
    render :action => 'new'
  end
end

#destroyObject



50
51
52
53
54
55
56
57
# File 'app/controllers/admin/menus_controller.rb', line 50

def destroy
  if @menu.destroy
    flash[:notice] = t('menu.destroy.success').capitalize
  else
    flash[:error] = t('menu.destroy.failed').capitalize
  end
  return redirect_to([forgeos_cms, :admin, :menus])
end

#duplicateObject



22
23
24
25
# File 'app/controllers/admin/menus_controller.rb', line 22

def duplicate
  @menu = @menu.clone
  render :action => 'new'
end

#editObject



37
38
# File 'app/controllers/admin/menus_controller.rb', line 37

def edit
end

#indexObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/admin/menus_controller.rb', line 6

def index
  respond_to do |format|
    format.html
    format.json do
      sort
      render :layout => false
    end
  end
end

#newObject



19
20
# File 'app/controllers/admin/menus_controller.rb', line 19

def new
end

#showObject



16
17
# File 'app/controllers/admin/menus_controller.rb', line 16

def show
end

#updateObject



40
41
42
43
44
45
46
47
48
# File 'app/controllers/admin/menus_controller.rb', line 40

def update
  if @menu.update_attributes(params[:menu])
    flash[:notice] = t('menu.update.success').capitalize
    redirect_to([forgeos_cms, :edit, :admin, @menu])
  else
    flash[:error] = t('menu.update.failed').capitalize
    render(:action => 'edit')
  end
end