Created
October 26, 2010 21:58
-
-
Save mdeering/647919 to your computer and use it in GitHub Desktop.
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
module Admin::SnippetHelper | |
def render_snippet(snippet_name, args = nil) | |
RedCloth.new(Liquid::Template.parse(Snippet.find_by_title!(snippet_name).content).render args).to_html.html_safe | |
rescue ActiveRecord::RecordNotFound => error | |
error.message.html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment