Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created November 8, 2010 20:22
Show Gist options
  • Save eqdw/668200 to your computer and use it in GitHub Desktop.
Save eqdw/668200 to your computer and use it in GitHub Desktop.
##in view:
link_to "TEST", blog_path(:year => 2010, :month => 09)
##when routes looks like:
match 'blog', => 'blog#index'
match 'blog(/:year/:month)' => 'blog#index'
## ===> website.com/blog?year=2010&month=09
##however, when routes looks like:
match 'blog', => 'blog#index'
match 'blog(/:year/:month)' => 'blog#index', :as => "blog" ####ADDED AS
## ===> website.com/blog/2010/09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment