Sha256: 26380003ad7a74666d383ec7018e01a34d544e215f7fe7991a952127880e7b03
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
module MarkdownPreview # The helper module we include into ActionController::Base module Helpers # Has uses_markdown_preview method been declared in the controller for this page? def using_markdown_preview? !@uses_markdown_preview.blank? end # Form a JS include tag for the MarkdownPreview JS src for inclusion in the <head> def include_markdown_preview_js #javascript_include_tag (Rails.env.to_s == 'development' ? "markdown_preview/markdown_preview" : "markdown_preview/markdown_preview.min") javascript_include_tag (Rails.env.to_s == 'development' ? "markdown_preview/markdown_preview" : "markdown_preview/markdown_preview") end # Form a JS include tag for the MarkdownPreview JS src for inclusion in the <head> def include_markdown_preview_css stylesheet_link_tag( "markdown_preview/markdown_preview" ) end # Form a JS include tag for the MarkdownPreview JS src, and form the raw JS and wrap # in in a <script> tag for inclusion in the <head> for inclusion in the <head> def include_markdown_preview_if_needed(options = {}, raw_options = nil) if using_markdown_preview? include_markdown_preview_js + include_markdown_preview_css end end end end
Version data entries
6 entries across 6 versions & 1 rubygems