Sha256: 4b605f3f49ca8446f608e1ac010a09d4256a07961ae7498d25a8f71861a05f32

Contents?: true

Size: 944 Bytes

Versions: 9

Compression:

Stored size: 944 Bytes

Contents

# Add ContentHelper in your Controller
#
#   class PostsController < ApplicationController
#     include RailsAdminContentBuilder::ContentBuilderHelpers
#
#     def index
#     end
#   end
module RailsAdminContentBuilder
  # This is a Module
  module ContentBuilderHelpers
    # Return content Object
    #
    #   @content = content_created
    def content_created
      set_content_builder
    end

    # Return all contents created
    #
    #   @content = all_contents_created
    def all_contents_created
      set_content_builder.where(status: true)
    end

    # Return specific contents created by slug
    #
    #   @content = find_content_created_by_slug('slug')
    def find_content_created_by_slug(slug)
      set_content_builder.where(status: true, slug: slug).first
    end

    # Return object RailsAdminContentBuilder::ContentBuilder
    def set_content_builder
      RailsAdminContentBuilder::ContentBuilder
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rails_admin_content_builder_rails_6-1.2.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder_rails_6-1.1.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder_rails_6-1.0.1 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder_rails_6-1.0.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder-1.3.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder-1.2.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder-1.1.0 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder-1.0.6 app/helpers/rails_admin_content_builder/content_builder_helpers.rb
rails_admin_content_builder-1.0.5 app/helpers/rails_admin_content_builder/content_builder_helpers.rb