/ Published in: Ruby
used to remove unnecessary duplication of code. Code is from Jamis Buck (http://weblog.jamisbuck.org/2007/1/24/object-with_options)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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