Sha256: f844d761c8e930f929689ad6098208362000ad2a22d463502168849573a999c7

Contents?: true

Size: 902 Bytes

Versions: 45

Compression:

Stored size: 902 Bytes

Contents

class Pulitzer::LayoutsController < Pulitzer::ApplicationController
  before_filter :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
    render nothing: true
  end

  protected

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

  def layout_params
    params[:layout].permit!
  end

end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
pulitzer-0.12.5 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.12.4 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.12.3 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.12.2 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.12.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.12.0 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.11.3 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.11.2 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.11.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.11.0 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.10.3 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.10.2 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.10.1 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.10.0 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.14 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.13 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.11 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.10 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.9 app/controllers/pulitzer/layouts_controller.rb
pulitzer-0.5.8 app/controllers/pulitzer/layouts_controller.rb