Skip to content

Instantly share code, notes, and snippets.

@BaylorRae
Last active August 29, 2015 14:00
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 BaylorRae/a1c785837b0d4e1b1f8a to your computer and use it in GitHub Desktop.
Save BaylorRae/a1c785837b0d4e1b1f8a to your computer and use it in GitHub Desktop.
Category Links
<% Category.order(:title).each do |category| %>
<%= link_to category.title, category_products_path(category.id) %>
<% end %>
# Prefix Verb URI Pattern Controller#Action
# category_products GET /categories/:category_id/products(.:format) products#index
resources :categories do
resources :products
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment