Sha256: f2307d347307333647ea905b4246c99eb0316c635fc423f2a9bc459092e604f6
Contents?: true
Size: 745 Bytes
Versions: 9
Compression:
Stored size: 745 Bytes
Contents
module QuickScript module Helpers def jsify(model, opt=:full) raw (model ? model.to_api(opt).to_json : 'null') end def jqtpl(name, &block) raw "<script id='#{name}' type='text/html'>#{capture(&block)}</script>" end def include_view_box raw "<div data-bind=\"template: {name : getViewBoxTemplate}, attr : {class : 'view-box view-box-' + transition.type}\"></div>" end def include_quick_script_init(app_model) javascript_tag do "CURRENT_USER = null; appViewModel = null; overlay = null; $(function() { initKO(); CURRENT_USER = (#{jsify current_user, :me}); appViewModel = new #{app_model}(); initApp(); console.log('Initialized...'); });".html_safe end end end end
Version data entries
9 entries across 9 versions & 1 rubygems