Sha256: bdaedd591e4a5d1aea852657b766e076e2b2838ecd9d3292bbd19ef1f905281e

Contents?: true

Size: 756 Bytes

Versions: 18

Compression:

Stored size: 756 Bytes

Contents

module ApplicationHelper
  def render_partial(partial, locals={}, &block)
    render(
      partial: partial,
      locals: locals.merge(block: block)
    )
  end

  def render_mustache(template, object)
    mustache = Mustache.new
    mustache.template_extension = 'mustache'
    # mustache.template_path = Rails.root.join("assets/templates")
    # mustache.template_file = Rails.root.join("assets/templates/#{template}.mustache")
    mustache.template_path = Rails.root.join("app/views")
    mustache.template_file = Rails.root.join("app/views/#{template}.mustache")
    mustache.instance_eval %%
      def logged_in
        #{!!current_user}
      end
    %
    # mustache.template_extension = 'mustache'
    mustache.render(object).html_safe
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
mvpkit-0.8.1 project/app/helpers/application_helper.rb
mvpkit-0.8.0 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.15 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.14 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.13 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.12 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.11 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.10 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.9 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.8 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.7 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.6 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.5 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.4 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.3 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.2 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.1 project/app/helpers/application_helper.rb
minimum_viable_product-0.7.0 project/app/helpers/application_helper.rb