RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: harn
respond_to do |format| format.html { render action: request.path[1..-1], status: request.path[1..-1] } format.json { render json: {status: request.path[1..-1], error: @exception.message}, status: request.path[1..-1]} end
respond_to do |format| format.html { render action: request.path[1..-1], status: 404 } format.json { render json: {status: request.path[1..-1], error: @exception.message}, status: 404} end
Using status respond to the error is better for others system knows what is happeing
Using status respond to the error is better for others system knows what is happeing