Class: BlueberryCMS::Admin::MenusController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @menu = Menu.new(menu_params)
  if @menu.save
    redirect_to(params[:continue] ? [:edit, :admin, @menu] : [:admin, :menus])
  else
    render :new
  end
end

#destroyObject



34
35
36
37
# File 'app/controllers/blueberry_cms/admin/menus_controller.rb', line 34

def destroy
  @menu.destroy
  redirect_to [:admin, :menus]
end

#editObject



24
# File 'app/controllers/blueberry_cms/admin/menus_controller.rb', line 24

def edit; end

#indexObject



7
8
9
# File 'app/controllers/blueberry_cms/admin/menus_controller.rb', line 7

def index
  @menus = Menu.ordered
end

#newObject



11
12
13
# File 'app/controllers/blueberry_cms/admin/menus_controller.rb', line 11

def new
  @menu = Menu.new
end

#updateObject



26
27
28
29
30
31
32
# File 'app/controllers/blueberry_cms/admin/menus_controller.rb', line 26

def update
  if @menu.update(menu_params)
     redirect_to(params[:continue] ? [:edit, :admin, @menu] : [:admin, :menus])
  else
    render :edit
  end
end