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