Should allow server side 201 with one cute line of code
Reported by Guilherme Silveira | April 3rd, 2010 @ 08:41 PM | in v0.9
In order to support 201 on resource creation, Restfulie currently requires you to:
1) respond_with @order, :status => 201, :location =>
order_url(@order)
and create a create.tokamak file
2) render :text => "" , :status => 201, :location => order_url(@order)
(head 201, :location ...) is not an option because Rails seems to wrongly send a one whitespace string as a result.
Both should be easier implemented as something like the following, automatically noticing its a 201 and requires the Resource location, while rendering it with the resource itself (show.tokamak).
respond_with @order, :status => 201
Comments and changes to this ticket
-
Guilherme Silveira June 3rd, 2010 @ 11:52 AM
- Milestone set to v0.9
- Assigned user set to Guilherme Silveira
-
Guilherme Silveira June 10th, 2010 @ 04:13 PM
- Assigned user cleared.
responder should check if resource.created? then return a 201!
-
Guilherme Silveira June 10th, 2010 @ 04:14 PM
it should be possible to override this and say, i want to go to to the rendering process (i.e. the html)
-
Guilherme Silveira June 11th, 2010 @ 09:17 PM
- Tag changed from server to feature, server
- State changed from new to resolved
- Assigned user set to Guilherme Silveira
respond_with @resource, :status => 201
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »