Sha256: c43d776f2d41e2377736f15b159725925d967771b7392232dc07976f9aff95db

Contents?: true

Size: 664 Bytes

Versions: 7

Compression:

Stored size: 664 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
        #
        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

7 entries across 7 versions & 1 rubygems

Version Path
archangel-0.0.8 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.7 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.6 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.5 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.4 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.3 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb
archangel-0.0.2 lib/archangel/liquid/tags/csrf_meta_tags_tag.rb