Sha256: e5d3de813b7e94e3706edf1e61465b9b55b24c366f36d80b0ecdfb58c6874851

Contents?: true

Size: 1.46 KB

Versions: 13

Compression:

Stored size: 1.46 KB

Contents

class Pulitzer::SequenceFlowStylesController < Pulitzer::ApplicationController
  before_action :get_sequence_flow_style, only: [:show, :edit, :update, :destroy]

  def new
    @sequence_flow_style = Pulitzer::SequenceFlowStyle.new(sequence_flow_style_params)
    render partial: 'new', locals: {sequence_flow_style: @sequence_flow_style}
  end

  def create
    @sequence_flow_style = Pulitzer::SequenceFlowStyle.create(sequence_flow_style_params)
    if @sequence_flow_style.errors.empty?
      render partial: 'show_wrapper', locals: {sequence_flow_style: @sequence_flow_style}
    else
      render partial: 'new', locals: {sequence_flow_style: @sequence_flow_style}, status: 409
    end
  end

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

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

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

  def destroy
    @sequence_flow_style.destroy
    head :ok
  end

  protected

  def get_sequence_flow_style
    @sequence_flow_style = Pulitzer::SequenceFlowStyle.find(params[:id])
  end

  def sequence_flow_style_params
    params[:sequence_flow_style].permit!
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pulitzer-0.15.12 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.11 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.10 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.9 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.8 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.7 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.6 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.5 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.4 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.3 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.2 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.1 app/controllers/pulitzer/sequence_flow_styles_controller.rb
pulitzer-0.15.0 app/controllers/pulitzer/sequence_flow_styles_controller.rb