Sha256: 133869a2b8f3bbcface447a5face47b51f39e3c92082d6166d1c59770ab8a0d1
Contents?: true
Size: 760 Bytes
Versions: 11
Compression:
Stored size: 760 Bytes
Contents
module Cms class PortletsController < Cms::ContentBlockController before_action :apply_blacklist, only: [:new, :create] protected # Ensure we can't create portlets on the blacklist of types. # Existing instances can be edited/deleted. def apply_blacklist if params[:type] && Cms::Portlet.blacklisted?(params[:type].to_sym) render status: :method_not_allowed end end def build_block if params[:type].blank? @block = model_class.new else @block = params[:type].classify.constantize.new(params[:portlet]) end end def update_block load_block @block.update(params[:portlet]) end def block_form "portlets/portlets/form" end end end
Version data entries
11 entries across 11 versions & 2 rubygems