Module: Progstr::Filer::Html
- Defined in:
- lib/filer/views/html.rb
Instance Method Summary collapse
Instance Method Details
#filer_scripts ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/filer/views/html.rb', line 22 def filer_scripts prefix = Progstr::Filer.asset_url_prefix || Progstr::Filer.default_asset_url_prefix scripts = [ "/upload.js", "/pl/flash.support.js", ] = scripts.map do |script| javascript_include_tag (prefix + script) end .join("\r\n").html_safe end |
#filer_upload(attachment, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/filer/views/html.rb', line 4 def filer_upload(, = {}) client_id = generate_container_id register_scripts = (, ) = MultiJson.encode() init_script = <<EOJSON $(function(){ $('\##{client_id}').filerUpload(#{}) }) EOJSON "<div id=\"#{client_id}\"></div>".html_safe + javascript_tag(init_script) end |