hoangdangninh
7/8/2017 - 8:32 PM

From https://stackoverflow.com/questions/22078627/how-do-i-render-a-partial-from-the-rails-console

# initial setup
view_paths = Rails::Application::Configuration.new(Rails.root).paths["app/views"]
av_helper = ActionView::Base.new view_paths

# (Optional) include this if your partial uses route helpers:
include Rails.application.routes.url_helpers

av_helper.render "path/to/your/partial"

# Several options to use with render, for example render plain: | text: | html: | template: | partial: |