Sha256: d762c5eebcbbd628ecfae52b77e99fb1a855ee7696f862a192831430447eb97d

Contents?: true

Size: 584 Bytes

Versions: 10

Compression:

Stored size: 584 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.target << result
		when ActionView::Helpers::TagHelper::TagBuilder
			Phlex::Rails::Buffered.new(
				result,
				view: self
			)
		end
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
phlex-rails-1.2.2 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.2.1 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.2.0 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.1.2 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.1.1 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.1.0 lib/phlex/rails/helpers/tag.rb
phlex-rails-1.0.0 lib/phlex/rails/helpers/tag.rb
phlex-rails-0.10.0 lib/phlex/rails/helpers/tag.rb
phlex-rails-0.8.1 lib/phlex/rails/helpers/tag.rb
phlex-rails-0.9.0 lib/phlex/rails/helpers/tag.rb