Class: Admin::BlockLayoutsController

Inherits:
ForestController
  • Object
show all
Defined in:
app/controllers/admin/block_layouts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/admin/block_layouts_controller.rb', line 17

def create
  @block_layout = BlockLayout.new(block_layout_params)
  authorize @block_layout

  if @block_layout.save
    redirect_to edit_admin_block_layout_path(@block_layout), notice: 'BlockLayout was successfully created.'
  else
    render :new
  end
end

#editObject



13
14
15
# File 'app/controllers/admin/block_layouts_controller.rb', line 13

def edit
  authorize @block_layout
end

#indexObject



4
5
6
# File 'app/controllers/admin/block_layouts_controller.rb', line 4

def index
  @block_layouts = apply_scopes(BlockLayout).by_id.page params[:page]
end

#newObject



8
9
10
11
# File 'app/controllers/admin/block_layouts_controller.rb', line 8

def new
  @block_layout = BlockLayout.new
  authorize @block_layout
end

#updateObject



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

def update
  authorize @block_layout

  if @block_layout.update(block_layout_params)
    redirect_to edit_admin_block_layout_path(@block_layout), notice: 'BlockLayout was successfully updated.'
  else
    render :edit
  end
end