Sha256: e4c9f765c9c20da1b55ace6bc2107de47a53eb4b6a8724b3a4dd28f6013a4e81
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
module Fuel module PostsHelper Fuel.configuration.helpers.each do |helper| include "::#{helper}".constantize end def markdown(text) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true) raw markdown.render(text) end def method_missing method, *args, &block fuel.send(method, *args) end def embedded_svg filename, options={} path = Rails.application.assets.find_asset(filename).pathname file = File.read(path) doc = Nokogiri::HTML::DocumentFragment.parse file svg = doc.at_css 'svg' if options[:class].present? svg['class'] = options[:class] end doc.to_html.html_safe end def hide_published_at(post) @post.is_published ? '' : 'display:none;' end def s3_direct_post @s3_direct_post ||= ( return unless s3_bucket.present? s3_bucket.presigned_post(key: "uploads/#{SecureRandom.uuid}/${filename}", success_action_status: 201, acl: :public_read) ) end def format_options Fuel::Post::Formats::DISPLAY.dup.invert end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fuel-0.4.2 | app/helpers/fuel/posts_helper.rb |