Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Articles < Application
- controlling :articles do |a|
- a.action :new, :only_provides => :html
- a.action :edit, :only_provides => :html
- a.action :create, :provides => [ :xml, :json, :yml ] do
- a.on_success { display member, :status => 201, :location => resource(member) }
- a.on_failure { display member.errors, :status => 422 }
- end
- a.action :update, :provides => [ :xml, :json, :yml ] do
- a.on_success { EMPTY_RESPONSE }
- a.on_failure { display member.errors, :status => 422 }
- end
- a.action :destroy, :provides => [ :xml, :json, :yml ] do
- a.on_success { EMPTY_RESPONSE }
- end
- end
- end
Add Comment
Please, Sign In to add comment