Ruby on Rails - Make Slim the Default Template

£可爱£侵袭症+ 提交于 2019-11-29 01:14:07

You can use "slim-rails" gem which is built for generating slim template as default.

https://github.com/slim-template/slim-rails

Just replace gem 'slim' by gem 'slim-rails' in your Gemfile.

In you Gemfile, include

gem 'slim-rails'

And to generate slim tempage, in config/application.rb add this line of code

class Application < Rails::Application
........................................

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