Class: Blocky::ContentBlocksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/blocky/content_blocks_controller.rb

Instance Method Summary collapse

Methods included from Auth

#blocky_current_user, #current_ability, #devise_resource_name, #login_redirect_path, #redirect_back_or_default, #store_location, #unauthorized

Instance Method Details

#editObject



7
8
# File 'app/controllers/blocky/content_blocks_controller.rb', line 7

def edit
end

#indexObject



10
11
12
13
# File 'app/controllers/blocky/content_blocks_controller.rb', line 10

def index
  @global_content_blocks = Blocky::ContentBlock.global
  @content_blocks = Blocky::ContentBlock.per_page
end

#showObject



15
16
17
# File 'app/controllers/blocky/content_blocks_controller.rb', line 15

def show
  redirect_to action: :edit
end

#updateObject



19
20
21
22
23
24
25
# File 'app/controllers/blocky/content_blocks_controller.rb', line 19

def update
  if @content_block.update(content_block_params)
    redirect_to content_blocks_url, notice: "Content block :#{@content_block.name} was updated successfully."
  else
    render action: :edit
  end
end