Created
June 4, 2009 03:26
-
-
Save jhubert/123407 to your computer and use it in GitHub Desktop.
This file contains 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_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