Return to Snippet

Revision: 2256
at January 24, 2007 15:17 by andyh


Updated Code
map.with_options :controller => "message" do |msg|
  msg.create_message "/msg/create/:id", :action => "create"
  msg.delete_message "/msg/delete/:id", :action => "delete"
  msg.message "/msg/:id", :action => "get"
end

Revision: 2255
at January 24, 2007 15:13 by andyh


Initial Code
map.with_options :controller => "message" do |msg|
  msg.create_message "/msg/create/:id", :action => "create"
  msg.delete_message "/msg/delete/:id", :action => "delete"
  msg.message "/msg/:id", :action => "get"
  # etc, etc, etc
end

Initial URL

                                

Initial Description
used to remove unnecessary duplication of code. Code is from Jamis Buck (http://weblog.jamisbuck.org/2007/1/24/object-with_options)

Initial Title
with_options to DRY up route creation

Initial Tags
rails, ruby

Initial Language
Ruby