ロutesノート

1188 ワード

例:

 
ruby
  1. map.admin_report 'report/:year',    
  2.                  :controller => 'admin',    
  3.                  :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
  1. <%= link_to "Administrative Report", admin_report_url(:year => 2005) %>