Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map.connect ':controller/:action/:user_name'
- @params = {:controller => "profile", :action=> "view", :user_name => "john"}
- map.connect ':controller/:action/:user_name',
- :requirements => {:user_name => /w+/}
- class User < ActiveRecord::Base
- def to_param
- "#{id}-#{name.gsub(/W/, '-').downcase}"
- end
- end
- map.resources :users
Add Comment
Please, Sign In to add comment