How can I convert html.slim files to html or html.erb?

Aswathy picture Aswathy · Feb 4, 2015 · Viewed 16.5k times · Source

I need to convert the html.slim files in my Ruby on Rails application to html.erb. Is there any easy way to do it? I tried many options listed in Stack Overflow and other sites. But nothing worked for me. I found a converter http://slim2html.raving.systems/ and a html to slim converter http://html2slim.herokuapp.com/ . It is not of my use since it does not work the other way around. Should I have to do it manually? Please help.

Answer

Sirat picture Sirat · May 27, 2016

I just did it using Codepen.io

Start a new pen. Choosing Slim as your HTML Markdown language. Paste in your Slim - then click the view compiled button in your HTML pane.

You'll see the straight HTML version of your markup.

You can then copy that out.