Sha256: 67f67298cdd0bafc719295350c84891eb392a167e4e0128c21ab3101dac46f1b

Contents?: true

Size: 435 Bytes

Versions: 3

Compression:

Stored size: 435 Bytes

Contents

require 'flapjack/utility'

module ErbViewHelper

  TEMPLATE_PATH = File.dirname(__FILE__) +
      '/../../lib/flapjack/gateways/web/views/'

  include Flapjack::Utility

  def render_erb(file, bind)
    erb = ERB.new(File.read(TEMPLATE_PATH + file), nil, '-')
    erb.result(bind)
  end

  def page_title(string)
    @page_title = string
  end

  def h(text)
    ERB::Util.h(text)
  end

  def u(text)
    ERB::Util.u(text)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flapjack-2.0.0 spec/support/erb_view_helper.rb
flapjack-2.0.0rc1 spec/support/erb_view_helper.rb
flapjack-2.0.0b1 spec/support/erb_view_helper.rb