Rails: Render view from outside controller
Rails 5 and 6 support this in a much more convenient manner that handles creating a request and whatnot behind the scenes: rendered_string = ApplicationController.render( template: ‘users/show’, assigns: { user: @user } ) This renders app/views/users/show.html.erb and sets the @user instance variable so you don’t need to make any changes to your template. It automatically … Read more