Class: Pulitzer::ArrangementStylesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/pulitzer/arrangement_styles_controller.rb', line 10

def create
  @arrangement_style = Pulitzer::ArrangementStyle.create(arrangement_style_params)
  if @arrangement_style.errors.empty?
    render partial: 'show_wrapper', locals: {arrangement_style: @arrangement_style}
  else
    @post_type = @arrangement_style.post_type
    render partial: 'new', locals: {arrangement_style: @arrangement_style}
  end
end

#destroyObject



37
38
39
40
# File 'app/controllers/pulitzer/arrangement_styles_controller.rb', line 37

def destroy
  @arrangement_style.destroy
  head :ok
end

#editObject



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

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

#newObject



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

def new
  @arrangement_style = Pulitzer::ArrangementStyle.new(arrangement_style_params)
  @post_type = @arrangement_style.post_type
  render partial: 'new', locals: {arrangement_style: @arrangement_style}
end

#showObject



20
21
22
# File 'app/controllers/pulitzer/arrangement_styles_controller.rb', line 20

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

#updateObject



28
29
30
31
32
33
34
35
# File 'app/controllers/pulitzer/arrangement_styles_controller.rb', line 28

def update
  @arrangement_style.update_attributes(arrangement_style_params)
  if @arrangement_style.errors.empty?
    render partial: 'show', locals: {arrangement_style: @arrangement_style}
  else
    render partial: 'form', locals: {arrangement_style: @arrangement_style}, status: 409
  end
end