ruby on rails - Best practice for respond_with? -


i wondering best way handle http errors within respond_with method in rails:

respond_to :html, :json  # @my_resources = []  def index   respond_with @my_resources end 

this action responding http 200 status code. http 204 "no content" response http request, , seems fit better correct answer original request of client (with json format). same behaviour happens other request , responses.

linking w3's raccomendation 204 response code

http://www.w3.org/protocols/rfc2616/rfc2616-sec10.html


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -