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