Class: Admin::MenusController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @menu = Effective::Menu.new(menu_params)
  @page_title = 'New Menu'

  authorize_effective_menus!

  if @menu.save
    flash[:success] = 'Successfully created menu'
    redirect_to effective_pages.admin_menu_path(@menu)
  else
    flash.now[:danger] = 'Unable to create menu'
    render :action => :new
  end
end

#indexObject



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

def index
  @datatable = EffectiveMenusDatatable.new(self)
  @page_title = 'Menus'

  authorize_effective_menus!
end

#newObject



16
17
18
19
20
21
# File 'app/controllers/admin/menus_controller.rb', line 16

def new
  @menu = Effective::Menu.new()
  @page_title = 'New Menu'

  authorize_effective_menus!
end

#showObject



38
39
40
41
42
43
# File 'app/controllers/admin/menus_controller.rb', line 38

def show
  @menu = Effective::Menu.find(params[:id])
  @page_title = @menu.to_s

  authorize_effective_menus!
end