Sha256: 806521c5017299af465d7b5c71b2b6500a49371b9060513a529aa7b76afcf27e
Contents?: true
Size: 1.54 KB
Versions: 7
Compression:
Stored size: 1.54 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) @post_type = @sequence_flow_style.post_type 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 @post_type = @sequence_flow_style.post_type render partial: 'new', locals: {sequence_flow_style: @sequence_flow_style} 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
7 entries across 7 versions & 1 rubygems