Advertisement
ygamretuta

Rails - Shorthands

Oct 21st, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.29 KB | None | 0 0
  1. # redirect with flash message
  2. redirect_to @product, :notice => "My flash message"
  3.  
  4. # redirect to edit
  5. redirect_to [:edit, @product]
  6.  
  7. # select a format for a response
  8. respond_with(@product.to_xml)
  9.  
  10. # delegate response handling to a class
  11. respond_with(@product, :responder => MyClass)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement