Guest User

Untitled

a guest
Feb 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. class Articles < Application
  2.  
  3. controlling :articles do |a|
  4.  
  5. a.action :new, :only_provides => :html
  6. a.action :edit, :only_provides => :html
  7.  
  8. a.action :create, :provides => [ :xml, :json, :yml ] do
  9. a.on_success { display member, :status => 201, :location => resource(member) }
  10. a.on_failure { display member.errors, :status => 422 }
  11. end
  12.  
  13. a.action :update, :provides => [ :xml, :json, :yml ] do
  14. a.on_success { EMPTY_RESPONSE }
  15. a.on_failure { display member.errors, :status => 422 }
  16. end
  17.  
  18. a.action :destroy, :provides => [ :xml, :json, :yml ] do
  19. a.on_success { EMPTY_RESPONSE }
  20. end
  21.  
  22. end
  23. end
Add Comment
Please, Sign In to add comment