Module: Yacht::RailsHelper

Included in:
ApplicationHelper
Defined in:
lib/monkeypatches/rails_helper.rb

Instance Method Summary collapse

Instance Method Details

#yacht_js_snippet(opts = {}) ⇒ Object

Create a string with a javascript version of Yacht values intended for inclusion in an HTML page

Examples:

Set custom environment

yacht_js_snippet(:env => 'local_development')
# => "<script type=\"text/javascript\">;var Yacht = {\"foo\":\"bar\"};</script>"


7
8
9
# File 'lib/monkeypatches/rails_helper.rb', line 7

def yacht_js_snippet(opts={})
  javascript_tag Yacht::Loader.to_js_snippet(opts)
end