Sha256: 6e857aecf5074d9ed8210813b04c3e18da6fb36bd06da00eb07c1942c76417da

Contents?: true

Size: 901 Bytes

Versions: 19

Compression:

Stored size: 901 Bytes

Contents

class Pulitzer::LayoutsController < Pulitzer::ApplicationController
  before_action :get_layout, only: [:show, :edit, :update, :destroy]

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

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

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

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

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

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

  protected

  def get_layout
    @layout = Pulitzer::Layout.find(params[:id])
  end

  def layout_params
    params[:layout].permit!
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pulitzer-0.15.31 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.30 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.29 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.28 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.27 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.26 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.25 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.24 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.23 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.22 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.21 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.20 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.19 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.18 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.17 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.16 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.15 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.14 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.13 app/controllers/pulitzer/layouts_controller.rb