Class: Pulitzer::LayoutsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pulitzer/layouts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
# File 'app/controllers/pulitzer/layouts_controller.rb', line 10

def create
  @layout = Pulitzer::Layout.create(layout_params)
  render partial: 'show_wrapper', locals: {layout: @layout}
end

#destroyObject



28
29
30
31
# File 'app/controllers/pulitzer/layouts_controller.rb', line 28

def destroy
  @layout.destroy
  head :ok and return
end

#editObject



19
20
21
# File 'app/controllers/pulitzer/layouts_controller.rb', line 19

def edit
  render partial: 'form', locals: {layout: @layout}
end

#newObject



4
5
6
7
8
# File 'app/controllers/pulitzer/layouts_controller.rb', line 4

def new
  @layout = Pulitzer::Layout.new(layout_params)
  @post_type = @layout.post_type
  render partial: 'new', locals: {layout: @layout}
end

#showObject



15
16
17
# File 'app/controllers/pulitzer/layouts_controller.rb', line 15

def show
  render partial: 'show', locals: {layout: @layout}
end

#updateObject



23
24
25
26
# File 'app/controllers/pulitzer/layouts_controller.rb', line 23

def update
  @layout.update_attributes(layout_params)
  render partial: 'show', locals: {layout: @layout}
end