Skip to content

Instantly share code, notes, and snippets.

@ryanb
Created August 13, 2008 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanb/5261 to your computer and use it in GitHub Desktop.
Save ryanb/5261 to your computer and use it in GitHub Desktop.
def show
@category = Category.find_by_permalink(params[:category])
@page = @category.pages.find_by_permalink(params[:page])
end
map.category_page ':category/:page', :controller => 'pages', :action => 'show'
<!-- show for category demonstrating page links -->
<% for page in @cateogry.pages %>
<%= link_to h(page.name), category_page_path(@category.permalink, page.permalink) %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment