Module: Ace::Helper::Builder

Includes:
Base, ActionView::Helpers::JavaScriptHelper
Defined in:
lib/ace/helper.rb

Constant Summary

Constants included from Base

Ace::Helper::Base::EDITOR, Ace::Helper::Base::MODE, Ace::Helper::Base::THEME

Instance Method Summary collapse

Instance Method Details

#ace(code_string, &block) ⇒ Object

The javascript that runs:

  • Audio client based on gibberish.js

  • Ace editor with post code



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ace/helper.rb', line 14

def ace(code_string, &block)
  #string = hook_gac()
  string = hook_editor(MODE, THEME)
  string << hook_code(code_string)

  # FIX
  # When hook commands, the code do not appears on editor
  # string << hook_ace_commands(RENDER_OPTIONS[:commands])
  string = CoffeeScript.compile(string, :bare => true)
  javascript_tag(string, :id => "ace-#{Time.now}")
end