Sha256: 8d95360bc35ae670e95e2f655ff2215e18f69a88b44d93c1306107613fe34d2e
Contents?: true
Size: 1.14 KB
Versions: 3
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, tables: 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 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fuel-0.4.10 | app/helpers/fuel/posts_helper.rb |
fuel-0.4.9 | app/helpers/fuel/posts_helper.rb |
fuel-0.4.8 | app/helpers/fuel/posts_helper.rb |