How to Generate Views for Devise in HAML

陌路散爱 提交于 2019-12-03 02:38:51
DogpatchTech

Even simpler solution.

I have erb2haml installed in the development section of my Gemfile, so I just run:

rails generate devise:views
rake haml:erb2haml
# or
rake haml:replace_erbs # outdated

Done!

Ch Zeeshan

I have to do this

rails generate devise:views

gem "html2haml"
bundle install

for file in app/views/devise/**/*.erb; do html2haml -e $file ${file%erb}haml && rm $file; done

and now it is perfect.

Also see the devise wiki

Have a quick look here. It gives in details explanation itself from devise documentation

How-To:-Create-Haml-and-Slim-Views

seems that the option to indicate which template engine to use is missing (version 3.0.0). An issue has been open for this. https://github.com/plataformatec/devise/issues/2455

its simply erb to haml conversion case. you may use any sort of haml converter. Like this one http://htmltohaml.com/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!