[英]Rails generator `inject_into_file` at the end of file
Is there a way to append something to file using generator's inject_into_file
? 有没有一种方法可以使用生成器的
inject_into_file
将某些内容附加到文件中? It has to get a :before
or :after
parameter but what should I pass to just append something? 它必须有一个
:before
或:after
参数,但是我应该通过什么来追加一些东西呢?
Please use append_to_file 请使用append_to_file
append_to_file "file.rb" do
"hello"
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.