バッチ処理でhtmlを生成したかったのですが、controllerではなく、rakeやrunnerでhtmlを出力したかったので調べました。 結論だけを書くと # HTML生成用のクラス class ArticleView < ActionView::Base include Rails.application.routes.url_helpers include ActionView::Helpers::TagHelper def defalt_url_options {} end end def html_make @records = Article.all # 適当にインスタンス変数を呼び出す例 action_view = ArticleView.new(Rails.root.join("app", "views")) action_view.assign instance_var