comfy/comfortable-mexican-sofa — pull request #359 by hck (2013-10-23 07:58:13+00:00)
Title: Add ViewMethods#cms_snippet_exists? method.

This method can be used when you need to render a snippet surrounded by some markup only if snippet exists:

<% if cms_snippet_exists?(:sample_snippet) %>

<%= cms_snippet_content(:sample_snippet) %>

<% end %>

Also it is possible to render non-existing snippet without a block (default content):

<%= cms_snippet_content(:not_existing_snippet) %> # => '' (empty string), no errors raised