Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在rails 4中创建自己的生成器_Ruby On Rails - Fatal编程技术网

Ruby on rails 如何在rails 4中创建自己的生成器

Ruby on rails 如何在rails 4中创建自己的生成器,ruby-on-rails,Ruby On Rails,我想为scafflod创建自己的自定义生成器,以便可以更改特定应用程序的generated.html.erb或.html.haml的默认布局。 我想自定义布局当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局 在这里,您可能有一个制作生成器的好参考:当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局 在这里,您可能有一个制作生成器的好参考:当您希望将特定布局应用于少

我想为scafflod创建自己的自定义生成器,以便可以更改特定应用程序的generated.html.erb或.html.haml的默认布局。
我想自定义布局

当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局


在这里,您可能有一个制作生成器的好参考:

当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局


在这里,您可能有一个制作生成器的好参考:

当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局


在这里,您可能有一个制作生成器的好参考:

当您希望将特定布局应用于少数资源时,制作生成器是一个好主意。这可能就像你有一个普通的用户部分和管理用户部分不同的布局


您可能有一个很好的参考来制作发电机:

您可以用它做一些非常好的事情。问题是它的文档记录非常糟糕,但一旦您知道了各种模板文件的存储位置,您就可以开始移动了:

这一切都从lib/templates开始

lib/templates/active_record/model/model.rb contains the model template
lib/templates/factory_girl/model/fixtures.erb contains the factory girl template
lib/templates/rails/scaffold_controller/controller.rb the controller
lib/templates/rspec/model/model_spec.rb the rspec model
lib/templates/rspec/scaffold/controller_spec.rb the rspec controller
lib/templates/haml/scaffold/_form.html.haml the views (idem dito for edit, index, new and show)

如果你需要更多关于模板的信息,请告诉我

你可以用这个做一些很好的事情。问题是它的文档记录非常糟糕,但一旦您知道了各种模板文件的存储位置,您就可以开始移动了:

这一切都从lib/templates开始

lib/templates/active_record/model/model.rb contains the model template
lib/templates/factory_girl/model/fixtures.erb contains the factory girl template
lib/templates/rails/scaffold_controller/controller.rb the controller
lib/templates/rspec/model/model_spec.rb the rspec model
lib/templates/rspec/scaffold/controller_spec.rb the rspec controller
lib/templates/haml/scaffold/_form.html.haml the views (idem dito for edit, index, new and show)

如果你需要更多关于模板的信息,请告诉我

你可以用这个做一些很好的事情。问题是它的文档记录非常糟糕,但一旦您知道了各种模板文件的存储位置,您就可以开始移动了:

这一切都从lib/templates开始

lib/templates/active_record/model/model.rb contains the model template
lib/templates/factory_girl/model/fixtures.erb contains the factory girl template
lib/templates/rails/scaffold_controller/controller.rb the controller
lib/templates/rspec/model/model_spec.rb the rspec model
lib/templates/rspec/scaffold/controller_spec.rb the rspec controller
lib/templates/haml/scaffold/_form.html.haml the views (idem dito for edit, index, new and show)

如果你需要更多关于模板的信息,请告诉我

你可以用这个做一些很好的事情。问题是它的文档记录非常糟糕,但一旦您知道了各种模板文件的存储位置,您就可以开始移动了:

这一切都从lib/templates开始

lib/templates/active_record/model/model.rb contains the model template
lib/templates/factory_girl/model/fixtures.erb contains the factory girl template
lib/templates/rails/scaffold_controller/controller.rb the controller
lib/templates/rspec/model/model_spec.rb the rspec model
lib/templates/rspec/scaffold/controller_spec.rb the rspec controller
lib/templates/haml/scaffold/_form.html.haml the views (idem dito for edit, index, new and show)
如果你需要更多关于模板的信息,请告诉我