Sha256: 0e755a3cb31454707b2f668ceb452e137bd74b057c5ab80192decfb3888e264b
Contents?: true
Size: 1001 Bytes
Versions: 8
Compression:
Stored size: 1001 Bytes
Contents
class ContentBlocksController < ApplicationController load_and_authorize_resource except: :index before_action :load_featured_researchers, only: :index authorize_resource only: :index def index end def create @content_block.save if respond_to? :redirect_back redirect_back fallback_location: sufia.content_blocks_path else # Deprecated in Rails 5.0 redirect_to :back end end def update @content_block.update(update_params) if respond_to? :redirect_back redirect_back fallback_location: sufia.content_blocks_path else # Deprecated in Rails 5.0 redirect_to :back end end protected def create_params params.require(:content_block).permit([:name, :value, :external_key]) end def update_params params.require(:content_block).permit([:value, :external_key]) end def load_featured_researchers @content_blocks = ContentBlock.recent_researchers.page(params[:page]) end end
Version data entries
8 entries across 8 versions & 1 rubygems