Skip to content

Instantly share code, notes, and snippets.

@ejoubaud
Created January 22, 2020 08:38
Show Gist options
  • Save ejoubaud/ed4a7c7d7eb3919d559718cb2523a95c to your computer and use it in GitHub Desktop.
Save ejoubaud/ed4a7c7d7eb3919d559718cb2523a95c to your computer and use it in GitHub Desktop.
Slim to ERB (not perfect but good to get started)
# requires slim gem installed for slimrb, and brew install tidy-html5
file_name=./app/views/errors/show.html.slim
slimrb --erb "$file_name" \
| sed 's/::Temple::Utils\.escape_html((\(.*\))) %>/\1 %>/g' \
| tidy -q -i \
> ${file_name%.*}.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment