Created
September 11, 2012 21:39
-
-
Save srbiv/3702265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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