1
Here is my ajax request:
```
var that = this;
var url = "/edit_suggestions/" + that.id + "/accept.json";
$.ajax({
type: "PUT",
url: url,
success: callback
});
```
Here is the code in my controller:
```
respond_to do |format|
format.html { redirect_to @suggestion.question }
format.json { render :json => @suggestion }
end
```
Based on looking at my server logs, it completes the first request and then goes into the html response and tries to sent a `put` request to the questions/#{@suggestion.question.id} url instead of just returning the json. This ends with the error that the "get" request to this url failed.
improve this question
|
comment
Created at: 2013-11-15 00:39:30 UTC
By Nhull