Sha256: 43b6e5b65c135bd2d2fe61648b4fb4ada8ce27bb8dc7cda0c11dc01dc7d57a9e

Contents?: true

Size: 585 Bytes

Versions: 2

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

# An adapter for the <code>tag</code> helper.
# @note This helper is provided for completeness, but you should probably use Phlex tag methods directly instead.
module Phlex::Rails::Helpers::Tag
	# Builds HTML tags
	# @see https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag
	def tag(...)
		result = helpers.tag(...)

		case result
		when ActiveSupport::SafeBuffer
			@_context.buffer << result
		when ActionView::Helpers::TagHelper::TagBuilder
			Phlex::Rails::Buffered.new(
				result,
				view: self,
			)
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phlex-rails-2.0.0.beta2 lib/phlex/rails/helpers/tag.rb
phlex-rails-2.0.0.beta1 lib/phlex/rails/helpers/tag.rb