Skip to content

Instantly share code, notes, and snippets.

@lardawge
Created February 25, 2013 00:27
Show Gist options
  • Save lardawge/5026455 to your computer and use it in GitHub Desktop.
Save lardawge/5026455 to your computer and use it in GitHub Desktop.
Cleaner way to check for partial in rails 3.2
<% if lookup_context.template_exists?("custom_header/#{@object.key}", 'parent_path', true) %>
<%= render "custom_header/#{@object.key}" %>
<% else %>
Stock header
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment