Sha256: 83b7d03873c81792f3e96f638bab9769300dc0d3011da515e73f794e9749d87b
Contents?: true
Size: 704 Bytes
Versions: 20
Compression:
Stored size: 704 Bytes
Contents
class CMS::ViewTags attr_accessor :context, :controller delegate :current_user, :config, to: :context include Singleton include ApplicationHelper include ActionView::Helpers::TextHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::AssetTagHelper include ApplicationHelper include CMS::Helper include Rails.application.routes.url_helpers def setup opts @context = @controller = opts[:context] end def parse content, opts = {} setup(opts) # content.gsub(/\xA0/u, ' ') content.gsub(/\{\{image [^}}]+\}\}/) do |tag| str, name, size = tag.match(/\{\{image (\w+) (\w+)\}\}/).to_a cms_image(name, size) end.html_safe end end
Version data entries
20 entries across 20 versions & 1 rubygems