I added jQuery File Upload to my rails application recently, similar to the one shown at the following link: https://github.com/blueimp/jQuery-File-Upload/wiki/Rails-setup-for-V6 .
Each version of the rail implementation I've seen so far has <script id="template-download" type="text/x-tmpl"> -part. Inside these script tags, a template is used to place existing data.
There is also a version of <script id="template-download" type="text/x-jquery-tmpl"> at https://github.com/yortz/carrierwave_jquery_file_upload/blob/master/app/views/pictures/_template-download .html.erb , which is very similar to x-tmpl .
My questions:
What are the benefits of x-tmpl ?
At github.com/blueimp/jQuery-File-Upload/wiki/Template-Engine it says:
"However, you do not need to use this template engine and can replace it with another implementation by setting uploadTemplateId, downloadTemplateId, uploadTemplate and downloadTemplate Options" For me, this sounds like it can be used normal _partial_xy.html.erb instead of x-tmpl.
Am I mistaken?
If so, is it possible to at least use rail assistants inside the template, for example number_to_currency, or should I implement it, as is done for formatFileSize in jquery.fileupload-ui.js?
farukg
source share