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

Version Path
cmor_blog_backend-0.0.18.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.17.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.15.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.14.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.13.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.12.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.11.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.10.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.9.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.8.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.7.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.6.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.5.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.4.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.3.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.2.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.1.pre app/controllers/cmor/blog/backend/posts_controller.rb