Sha256: 1f9e18d146cd69df684a180a229447d6772855ca7540bfcbb46912f10ff9d0c4

Contents?: true

Size: 890 Bytes

Versions: 20

Compression:

Stored size: 890 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
  end

  protected

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

  def layout_params
    params[:layout].permit!
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pulitzer-0.15.12 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.11 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.10 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.9 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.8 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.7 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.6 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.5 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.4 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.3 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.2 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.15.0 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.14.4 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.14.3 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.14.2 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.14.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.14.0 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.13.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.13.0 app/controllers/pulitzer/layouts_controller.rb