Sha256: 78df8d3c7515b2d6e4000281538b0e7eecda73fbd6d46390700ecc003c245488

Contents?: true

Size: 696 Bytes

Versions: 1

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

module Archangel
  module Liquid
    module Tags
      ##
      # CSRF meta tag custom tag for Liquid
      #
      # Example
      #   {% csrf_meta_tags %}
      #
      class CsrfMetaTagsTag < ApplicationTag
        ##
        # Render the CSRF meta tags for the theme
        #
        # @param context [Object] the Liquid context
        # @return [String] the CSRF meta tags
        #
        # :reek:UtilityFunction
        def render(context)
          context.registers[:view].csrf_meta_tags
        end
      end
    end
  end
end

::Liquid::Template.register_tag("csrf_meta_tags",
                                Archangel::Liquid::Tags::CsrfMetaTagsTag)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.3.0 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb