gug*_*son 13 haml views scaffolding css3 ruby-on-rails-3
我正在使用带有Zune Foundation模板和haml的rails 3.1.我试图改变默认的脚手架视图模板以使用我想要的css的方法,所以我得到了所有脚手架的一致外观,而无需手动更改视图.我也使用simple_form.
由于我不想编写自己的生成器,是否有一些简单和/或推荐的方法来处理它?
约翰
Nin*_*nad 31
您可以通过在rails应用程序的"lib/templates/erb/scaffold"文件夹中创建自己的模板来覆盖默认视图模板.
lib/templates/erb/scaffold/_form.html.erb
lib/templates/erb/scaffold/edit.html.erb
lib/templates/erb/scaffold/index.html.erb
lib/templates/erb/scaffold/new.html.erb
lib/templates/erb/scaffold/show.html.erb
Run Code Online (Sandbox Code Playgroud)
可在此处找到默认模板 - https://github.com/rails/rails/tree/master/railties/lib/rails/generators/erb/scaffold/templates