例:
ruby 代码
- map.admin_report 'report/:year',
- :controller => 'admin',
- :action => 'report'
Having this named route in routes.rb tells Rails to create two new methods associated with this route: admin_report_url and hash_for_admin_report_url
则可以如下使用:
ruby 代码
- <%= link_to "Administrative Report", admin_report_url(:year => 2005) %>