Created
August 29, 2014 15:17
-
-
Save aalavandhan/a568e982c54a7fcea00b to your computer and use it in GitHub Desktop.
Rails simple render
This file contains hidden or 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 render(view_name) | |
filename = File.join "app", "views", "#{view_name}.html.erb" | |
template = File.read filename | |
eruby = Erubis::Eruby.new(template) | |
eruby.result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment