2009-05-07 18:13:27 +00:00
|
|
|
module SnippetFilter
|
|
|
|
def render_snippet(snippet_name)
|
|
|
|
|
|
|
|
snippet = Snippet.find_by_name(snippet_name)
|
|
|
|
|
|
|
|
if snippet
|
2009-07-06 08:23:34 +00:00
|
|
|
return Liquid::Template.parse( snippet.read_attribute( "content_#{I18n.locale}" ) ).render
|
2009-05-07 18:13:27 +00:00
|
|
|
else
|
|
|
|
return "nothing"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|