Skip to content

Instantly share code, notes, and snippets.

@ryanhanks
Created July 31, 2009 14:28
Show Gist options
  • Save ryanhanks/159244 to your computer and use it in GitHub Desktop.
Save ryanhanks/159244 to your computer and use it in GitHub Desktop.
Here is an example of how I use it in my a view (new.html.erb):
<% content_navigation %>
<%= render :partial => 'form' %>
==========
This is my application helper:
module ApplicationHelper
def content_navigation
content_for :content_navigation do
render :partial => 'navigation'
end
end
end
===============
Then I have a partial in my views/products folder called _navigation.html.erb that has the following:
<%= link_to "Products", products_path %>
I plan to put a set of navigation links in this partial, but I was just working on proof of concept at the moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment