Sha256: e7f61ccf21c6d2033f7267d088d9e3d7bbf457e40e70474aef7c832654c46b25

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require "active_support/concern"

module ViewComponent # :nodoc:
  module Previewable
    extend ActiveSupport::Concern

    included do
      # Set the location of component previews through app configuration:
      #
      #     config.view_component.preview_path = "#{Rails.root}/lib/component_previews"
      #
      mattr_accessor :preview_path, instance_writer: false

      # Enable or disable component previews through app configuration:
      #
      #     config.view_component.show_previews = true
      #
      # Defaults to +true+ for development environment
      #
      mattr_accessor :show_previews, instance_writer: false

      # Set the entry route for component previews through app configuration:
      #
      #     config.view_component.preview_route = "/previews"
      #
      # Defaults to +/rails/view_components+ when `show_previews' is enabled
      #
      mattr_accessor :preview_route, instance_writer: false do
        "/rails/view_components"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
view_component-2.13.0 lib/view_component/previewable.rb
view_component-2.12.0 lib/view_component/previewable.rb
view_component-2.11.1 lib/view_component/previewable.rb
view_component-2.11.0 lib/view_component/previewable.rb
view_component-2.10.0 lib/view_component/previewable.rb
view_component-2.9.0 lib/view_component/previewable.rb
view_component-2.8.0 lib/view_component/previewable.rb
view_component-2.7.0 lib/view_component/previewable.rb
view_component-2.6.0 lib/view_component/previewable.rb