I think prepare function as complex as this should go into the package itself, especially because you are the author of the package.  If you do that, people using other installation methods (manual/package.el) benefits from that.  Also, you don't need to send a pull request to add/remove autoload functions in the future.

If you don't want to use autoload cookie, how about create helm-rails-loaddefs.el or something like that containing prepare code above and load it via `:features`.