Class: ContentBlock::RichBlocksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/content_block/rich_blocks_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability

Instance Method Details

#createObject

POST /content-block/rich-blocks



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

def create
  @rich_block = RichBlock.new(rich_block_params)

  if @rich_block.save
    redirect_to @rich_block, notice: 'RichBlock was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /content-block/rich-blocks/1



47
48
49
50
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 47

def destroy
  @rich_block.destroy
  redirect_to rich_blocks_url, notice: 'RichBlock was successfully destroyed.'
end

#editObject

GET /content-block/rich-blocks/1/edit



23
24
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 23

def edit
end

#indexObject

GET /content-block/rich-blocks



9
10
11
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 9

def index
  @rich_blocks = RichBlock.all
end

#newObject

GET /content-block/rich-blocks/new



18
19
20
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 18

def new
  @rich_block = RichBlock.new
end

#showObject

GET /content-block/rich-blocks/1



14
15
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 14

def show
end

#updateObject

PATCH/PUT /content-block/rich-blocks/1



38
39
40
41
42
43
44
# File 'app/controllers/content_block/rich_blocks_controller.rb', line 38

def update
  if @rich_block.update(rich_block_params)
    redirect_to @rich_block, notice: 'RichBlock was successfully updated.'
  else
    render :edit
  end
end