Skip to content

Instantly share code, notes, and snippets.

@srbiv
Created September 11, 2012 21:39
Show Gist options
  • Save srbiv/3702265 to your computer and use it in GitHub Desktop.
Save srbiv/3702265 to your computer and use it in GitHub Desktop.
def initialize(partial_path)
@partial_path = partial_path
@output = ''
end
def render(locals)
render_content(locals)
rescue Exception => exception
format_error(exception)
end
private
def render_content(locals)
binding.pry
base.render(
partial: @partial_path,
locals: locals)
end
def base
ActionView::Base.new("app/views")
end
def format_error(exception)
<<-ERROR
#{exception.message}
#{exception.class.to_s}
ERROR
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment