Sha256: 6e857aecf5074d9ed8210813b04c3e18da6fb36bd06da00eb07c1942c76417da
Contents?: true
Size: 901 Bytes
Versions: 19
Compression:
Stored size: 901 Bytes
Contents
class Pulitzer::LayoutsController < Pulitzer::ApplicationController before_action :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 head :ok and return end protected def get_layout @layout = Pulitzer::Layout.find(params[:id]) end def layout_params params[:layout].permit! end end
Version data entries
19 entries across 19 versions & 1 rubygems