www.mysite.com/2008/02/5/28/18/30/20 which might mean:
www.mysite.com/year/month/week/day/hour/minute/second
There is something called as Route Globbing to solve this problem. In your routes.rb file specify the following line:
map.connect 'year/month/*values'
Routing engine bundles all the values after the third slash into params[:values] as an array. So your year/month action will have access to this array. The params[:value] will now look like ["5","28","18","30","20"].
If we want another controller to receive the URL, then we can say:
map.connect 'year/month/*values', :controller => "accounts"
Route globbing could be helpful if we are allowing users to enter some kind of organizational structure or file paths in to the URL.
No comments:
Post a Comment