-5

NOTE: I am trying to include the file upload system in my rails project. But I am getting issues with this EJS code. Please help me convert the below code into HAML code.

<script id="b-file-ejs" type="text/ejs">
            <div id="file-<%=FileAPI.uid(file)%>" class="js-file b-file b-file_<%=file.type.split('/')[0]%>">
                <div class="js-left b-file__left">
                    <img src="<%=icon[file.type.split('/')[0]]||icon.def%>" width="32" height="32" style="margin: 2px 0 0 3px"/>
                </div>
                <div class="b-file__right">
                    <div><a class="js-name b-file__name"><%=file.name%></a></div>
                    <div class="js-info b-file__info">size: <%=(file.size/FileAPI.KB).toFixed(2)%> KB</div>
                    <div class="js-progress b-file__bar" style="display: none">
                        <div class="b-progress"><div class="js-bar b-progress__bar"></div></div>
                    </div>
                </div>
                <i class="js-abort b-file__abort" title="abort">&times;</i>
            </div>
        </script>



Yu Hao
  • 119,891
  • 44
  • 235
  • 294

3 Answers3

0

You can also try this tool, sometimes it works better: http://www.htmltohaml.com/

Konrad
  • 1
  • 1
0

Have you tried using the following gem haml_ejs

check out this github link https://github.com/duncanbeevers/haml-ejs

level0
  • 323
  • 1
  • 3
  • 13
  • Yes i am using this gem. But I don't know how to use the variable in ejs. I want to use the value in class and id `code` `code`
    – Sunny Sharma Oct 17 '14 at 12:33
-1

You can use the below link convert HTML to HAML

http://html2haml.heroku.com/

VDN
  • 498
  • 3
  • 15