Skip to content

Instantly share code, notes, and snippets.

@jhubert
Created June 4, 2009 03:26
Show Gist options
  • Save jhubert/123407 to your computer and use it in GitHub Desktop.
Save jhubert/123407 to your computer and use it in GitHub Desktop.
def render_partial_if_exists(path)
render :partial => path if partial_template_exists?(path)
end
def partial_template_exists?(path)
erb_template_exists?(partial_pieces(path).join('/_'))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment