Posted By

andyh on 01/24/07


Tagged

rails ruby


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


with_options to DRY up route creation


 / 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)

  1. map.with_options :controller => "message" do |msg|
  2. msg.create_message "/msg/create/:id", :action => "create"
  3. msg.delete_message "/msg/delete/:id", :action => "delete"
  4. msg.message "/msg/:id", :action => "get"
  5. end

Report this snippet  

You need to login to post a comment.