Sha256: f04d5a4b5ac59a6feb57b46afa42f78c62e8896fa32b8ecdc5a6c223528c45eb

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 Bytes

Contents

module Rooler
  module ApplicationHelper
    
    def liquidize(content, arguments)
      Liquid::Template.parse(content).render(arguments, :filters => [Rooler::LiquidFilters]).html_safe
    end
    
    def render_tree(tree)
      res = "<ul>"
      res << "<li>#{tree.name}"
      tree.children.each {|child| res << render_tree(child)}
      res << "</li></ul>"
      res
    end
    
    def liquid_filters
      Rooler::LiquidFilters.instance_methods.inject({}) do |result, element|
        result[element] = Rooler::LiquidFilters.instance_method(element).parameters.map(&:last)
        result
      end
    end
     
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rooler-0.0.11 app/helpers/rooler/application_helper.rb
rooler-0.0.10 app/helpers/rooler/application_helper.rb
rooler-0.0.9 app/helpers/rooler/application_helper.rb