This project is archived and is in readonly mode.
respond_with fails silently on missing mimetype
-
José Valim
- Assigned user set to José Valim
- Milestone cleared.
Could you please provide a failing test case?
-
Jeremy Kemper
- State changed from new to open
-
José Valim
I cannot reproduce. Can you tell us what block you were passing to respond_with or respond_to which made this work?
Notice that in respond_with, PUT requests for XML and JSON formats returns a "head :ok" in case of success. This means that you won't get anything back, except a "200 OK" status in case of success. In cases of failure, it should render some content, but since you are calling @thing.save!, if the resource is invalid it will raise an exception and you in fact won't see the error message, but probably get a 500 error.
For invalid formats, your browser is returning a 406 Not Acceptable status, which also, does not give you anything back. Though that should probably return a 404 for html requests.
-
José Valim
- State changed from open to invalid
Closing. If you have any information to reproduce it on master, please let me know.
-
Nikolay Belous
- Importance changed from to High
class UsersController < ApplicationController
def create #POST
@user = User.first respond_with(@user) [#200](/projects/8994/tickets/200 "Ticket #200") OK, returns dataend
def show #GET: returns data
@user = User.first respond_with(@user) [#200](/projects/8994/tickets/200 "Ticket #200") OK, returns dataend
def update #PUT: no data
@user = User.first respond_with(@user) [#200](/projects/8994/tickets/200 "Ticket #200") OK, no dataend
def destroy #DELETE: no data
@user = User.first respond_with(@user) [#200](/projects/8994/tickets/200 "Ticket #200") OK, no dataend
end
I think this is very strange.