ryanb (owner)

Revisions

gist: 5261 Download_button fork
public
Public Clone URL: git://gist.github.com/5261.git
Embed All Files: show embed
pages_controller.rb #
1
2
3
4
5
def show
  @category = Category.find_by_permalink(params[:category])
  @page = @category.pages.find_by_permalink(params[:page])
end
 
routes.rb #
1
2
map.category_page ':category/:page', :controller => 'pages', :action => 'show'
 
show.html.erb #
1
2
3
4
5
6
7
<!-- show for category demonstrating page links -->
 
<% for page in @cateogry.pages %>
  <%= link_to h(page.name), category_page_path(@category.permalink, page.permalink) %>
<% end %>