Aswathy Aswathy - 9 months ago 356
HTML Question

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

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 and a html to slim converter . It is not of my use since it does not work the other way around. Should I have to do it manually? Please help.


You can!

First, make sure you have already installed slim-rails. You can install it by calling gem install slim-rails.

Then write something in the input.html

Finally, you open the terminal and call:

echo `slimrb input.html` > output.html

NOTE: it is `, not ' or "

Open file output.html, that's what you looking for!