Skip to content

Instantly share code, notes, and snippets.

@fabianvelizok
Last active February 27, 2024 22:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fabianvelizok/c929c8edaa3a4d6a5873 to your computer and use it in GitHub Desktop.
Save fabianvelizok/c929c8edaa3a4d6a5873 to your computer and use it in GitHub Desktop.
devise views to slim
rails generate devise:views
gem install html2slim
for file in app/views/devise/**/*.erb; do erb2slim $file ${file%erb}slim && rm $file; done
@boxmo
Copy link

boxmo commented Dec 18, 2023

For the NoMethodError File.exists? in ruby 3.2 you can do the following

# add this to your project Gemfile
gem "html2slim", github: "slim-template/html2slim" 
# run the following command 
for file in app/views/devise/**/*.erb; do bundle exec erb2slim $file ${file%erb}slim --trace && rm $file; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment