Rails generator `inject_into_file` at the end of file

1.4k Views Asked by At

Is there a way to append something to file using generator's inject_into_file? It has to get a :before or :after parameter but what should I pass to just append something?

1

There are 1 best solutions below

0
ytbryan On

Please use append_to_file

append_to_file "file.rb" do 
  "hello"
end