Class: Smithy::ContentBlocksController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/smithy/content_blocks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
# File 'app/controllers/smithy/content_blocks_controller.rb', line 17

def create
  @content_block = ContentBlock.new(filtered_params)
  @content_block.save
  flash.notice = "Your content_block was created" if @content_block.persisted?
  respond_with @content_block do |format|
    format.html { redirect_to [:edit, @content_block] }
  end
end

#destroyObject



39
40
41
42
43
# File 'app/controllers/smithy/content_blocks_controller.rb', line 39

def destroy
  @content_block = ContentBlock.find(params[:id])
  @content_block.destroy
  respond_with @content_block
end

#editObject



26
27
28
29
# File 'app/controllers/smithy/content_blocks_controller.rb', line 26

def edit
  @content_block = ContentBlock.find(params[:id])
  respond_with @content_block
end

#indexObject



8
9
10
# File 'app/controllers/smithy/content_blocks_controller.rb', line 8

def index
  respond_with @content_blocks
end

#newObject



12
13
14
15
# File 'app/controllers/smithy/content_blocks_controller.rb', line 12

def new
  @content_block = ContentBlock.new(filtered_params)
  respond_with @content_block
end

#updateObject



31
32
33
34
35
36
37
# File 'app/controllers/smithy/content_blocks_controller.rb', line 31

def update
  @content_block = ContentBlock.find(params[:id])
  flash.notice = "Your content_block was saved" if @content_block.update_attributes(filtered_params)
  respond_with @content_block do |format|
    format.html { redirect_to [:edit, @content_block] }
  end
end