Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Last active February 21, 2020 23:55
Show Gist options
  • Save tenderlove/b45a82cd920e368cfdf3e6164c5dadf0 to your computer and use it in GitHub Desktop.
Save tenderlove/b45a82cd920e368cfdf3e6164c5dadf0 to your computer and use it in GitHub Desktop.
#!/usr/bin/erb
<%= yield %>
#!/usr/bin/env ruby
# frozen_string_literal: true
require "action_controller"
require "action_view"
class TestController < ActionController::Base
self.view_paths = "."
def _prefixes; []; end # Search the current directory rather than "test/"
end
cv = TestController.new.view_context
puts cv.render("thing") { "<%= yield %>".html_safe }
# vim: ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment