Skip to content

Instantly share code, notes, and snippets.

@feymartynov
Last active January 4, 2016 19:19
Show Gist options
  • Save feymartynov/8666915 to your computer and use it in GitHub Desktop.
Save feymartynov/8666915 to your computer and use it in GitHub Desktop.
how to render a template in the rails console
controller = MyController.new
controller.request = OpenStruct.new(:session => [])
controller.view_renderer.render(controller.view_context, :file => 'path/to/template', :locals => {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment