Fix redirect in "disable responsive mode" link.
This commit is contained in:
@@ -29,13 +29,14 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#desktop-version-link a").click(function() {
|
$("#desktop-version-link a").click(function(e) {
|
||||||
$.ajax("/users/" + Danbooru.meta("current-user-id"), {
|
e.preventDefault();
|
||||||
|
$.ajax("/users/" + Danbooru.meta("current-user-id") + ".json", {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
data: {
|
data: {
|
||||||
"user[disable_responsive_mode]": "true"
|
"user[disable_responsive_mode]": "true"
|
||||||
}
|
}
|
||||||
}).success(function() {
|
}).then(function() {
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -68,7 +68,9 @@ class UsersController < ApplicationController
|
|||||||
else
|
else
|
||||||
flash[:notice] = "Settings updated"
|
flash[:notice] = "Settings updated"
|
||||||
end
|
end
|
||||||
respond_with(@user, location: edit_user_path(@user))
|
respond_with(@user) do |format|
|
||||||
|
format.html { redirect_back fallback_location: edit_user_path(@user) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user