Trying to convert *.html.slim views to *.html.erb. I've looked at these two questions:
How can I convert html.slim to html.erb? - getting
uninitialized constant
when called from the consoleHow can I convert html.slim files to html or html.erb? - parser hits a
NoMethodError: undefined method image_tag for nil:NilClass
when it comes across the first= image_tag
. I am not using any variables inside my call, the image tag points to and svg
I think the latter solution would work best, if the good people of Stack Overflow can help me figure out the image_tag
issue.
My code (as requested):
page data-id="foo-page"
.container
= image_tag 'bar.svg'
I was using gitbash on windows,
and this worked for me,
As expected, the latter solution worked. The trick is to pass
-e
flag, letting the interpreter know that you're converting toerb
. So the full command is:EDIT:
to make sure that the interperter omits unnecessary calls to
Temple::Utils.escape_html((...))
before variables, you can pass the--rails
flag like so: