Sha256: 557ea97b076f6be3ba4a3be965d20eb3bcadf7466a9d9f2fb0f3a7080512ad89
Contents?: true
Size: 1.35 KB
Versions: 37
Compression:
Stored size: 1.35 KB
Contents
module Cmor module Blog module Backend class PostsController < Cmor::Core::Backend::ResourcesController::Base include Rao::ResourcesController::ActsAsListConcern include Rao::ResourcesController::ActsAsPublishedConcern include Rao::ResourcesController::FriendlyIdConcern helper Cmor::Tags::Backend::ApplicationHelper if Cmor::Blog.features?(:cmor_tags) include Rao::Query::Controller::QueryConcern view_helper Rao::Query::ApplicationHelper, as: :query_helper def self.resource_class Cmor::Blog::Post end private def current_user_for_userstamp Cmor::Blog::Backend::Configuration.current_user_proc.call(self) end def initialize_resource super @resource.creator = current_user_for_userstamp end def initialize_resource_for_create super @resource.creator = current_user_for_userstamp end def load_collection_scope scope = super.friendly with_conditions_from_query(scope) end def load_resource_scope super.friendly end def permitted_params params.require(:post).permit(:title, :body, :published, :tag_list, assets: [], append_assets: [], overwrite_assets: []) end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems