Sha256: 1ed632168cd832e4e6104fc18226598aa36a7bd39c9661b869df100334bc6618

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 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_paths << "#{Rails.root}/lib/component_previews"
      #
      mattr_accessor :preview_paths, instance_writer: false

      # TODO: deprecated, remove in v3.0.0
      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

6 entries across 6 versions & 1 rubygems

Version Path
view_component-2.17.1 lib/view_component/previewable.rb
view_component-2.17.0 lib/view_component/previewable.rb
view_component-2.16.0 lib/view_component/previewable.rb
view_component-2.15.0 lib/view_component/previewable.rb
view_component-2.14.1 lib/view_component/previewable.rb
view_component-2.14.0 lib/view_component/previewable.rb