Created
December 5, 2008 14:09
-
-
Save snusnu/32342 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment