I am working on a rails engine and I am trying to write a generator that will put this line
do_stuff (foo)
as the last statement in config/routes.rb
, without breaking the file syntax.
Specifically, if my config/routes.rb
looks like this currently
Rails.application.routes.draw do
blah
more blah
end
After running the generator I would like the config/routes.rb
to look like this
Rails.application.routes.draw do
blah
more blah
do_stuff (foo) # injected line
end
I looked at what ActiveAdmin does, but am unable to create a blanket last line rule. Any help is greatly appreciated.
end
which could be a block. – Lett