Sha256: 1e4cec8c0bd7c426e2dcb43ad5074edb89dbbf1b3ce359fdf2dba9f7611676e4

Contents?: true

Size: 951 Bytes

Versions: 19

Compression:

Stored size: 951 Bytes

Contents

class Pulitzer::StylesController < Pulitzer::ApplicationController
  before_action :get_style, only: [:show, :edit, :update, :destroy]

  def index
    @ptcet = Pulitzer::PostTypeContentElementType.find(params[:post_type_content_element_type_id])
    render partial: 'index', locals: { ptcet: @ptcet }
  end

  def new
    @style = Pulitzer::Style.new(style_params)
    render partial: 'new', locals: { ptcet: @ptcet, style: @style }
  end

  def create
    @style = Pulitzer::Style.create(style_params)
    if @style.errors.empty?
      render partial: 'show_wrapper', locals: { style: @style }
    else
      render partial: 'new', locals: { style: @style }
    end
  end

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

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

  protected

  def get_style
    @style = Pulitzer::Style.find(params[:id])
  end

  def style_params
    params[:style].permit!
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

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