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.39.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.38.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.37.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.36.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.35.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.34.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.33.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.32.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.31.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.30.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.29.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.28.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.27.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.26.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.25.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.24.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.22.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.21.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.20.pre app/controllers/cmor/blog/backend/posts_controller.rb
cmor_blog_backend-0.0.19.pre app/controllers/cmor/blog/backend/posts_controller.rb