Module: Idecoder::ViewHelpers

Includes:
ActionView::Helpers::OutputSafetyHelper
Defined in:
lib/idecoder/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#render_idecoder(options = {}, dev_only = true) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/idecoder/view_helpers.rb', line 7

def render_idecoder options={}, dev_only=true
  if dev_only == false || (dev_only && ::Rails.env.development?)
    binding.local_variable_set(:options, options.to_json)
    template_file = ::File.read(::File.expand_path('../templates/idecoder.erb', __FILE__))
    raw ERB.new(template_file).result(binding)
  end
end