Sha256: 5e152263e78a05a3a488b4da785928ca768786c2c119af5f2fbd406c383cbbb3

Contents?: true

Size: 464 Bytes

Versions: 8

Compression:

Stored size: 464 Bytes

Contents

module Spina
  module Hooks
    class PartialComponent < ApplicationComponent
      with_collection_parameter :plugin

      def initialize(plugin:, partial:)
        @plugin = plugin
        @partial = partial
      end

      def call
        render partial: "spina/admin/hooks/#{@plugin.namespace}/#{@partial}"
      end

      def render?
        helpers.lookup_context.exists? "spina/admin/hooks/#{@plugin.namespace}/_#{@partial}"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spina-2.18.0 app/components/spina/hooks/partial_component.rb
spina-2.17.0 app/components/spina/hooks/partial_component.rb
spina-2.16.0 app/components/spina/hooks/partial_component.rb
spina-2.15.1 app/components/spina/hooks/partial_component.rb
spina-2.15.0 app/components/spina/hooks/partial_component.rb
spina-2.14.0 app/components/spina/hooks/partial_component.rb
spina-2.13.1 app/components/spina/hooks/partial_component.rb
spina-2.13.0 app/components/spina/hooks/partial_component.rb