Sha256: f971f905f95fda52a34dd228a9e878a509e231f03526f71d2ad5fede65dfac5a
Contents?: true
Size: 413 Bytes
Versions: 11
Compression:
Stored size: 413 Bytes
Contents
module Hicube module Liquid module Tags class UrlTag < ::Liquid::Tag def initialize(tag_name, name, tokens) super @doc = Hicube::Document.find_by(name: name) rescue end def render(context) @doc.nil? ? "document_not_found" : @doc.file_url end end ::Liquid::Template.register_tag('url_tag', UrlTag) end end end
Version data entries
11 entries across 11 versions & 1 rubygems