# 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_variables.each_with_object({}) { |name, hash| hash[name.slice(1, name.length)] = in