【发布时间】:2015-04-21 18:18:23
【问题描述】:
有人知道这个错误是从哪里来的吗?我是 AWS 的新手,相信它可能来自那里吗?
Excon::Errors::BadRequest in UsersController#update Expected(200) 实际(400 错误请求) excon.error.response :body => "\n
IncompleteBodyThe 请求正文已终止 意外9C1EC55648FB3ED91vv/2RNBp9egndYkTjzbCBgQu0jk3AjpAZffR+firWM4Yzd6ilQxJnfKwKZVK8+N" :headers => { "Connection" => "close" "Content-Type" => “应用程序/xml”“日期”=>“2015 年 4 月 21 日星期二 18:13:09 GMT”“服务器” => "AmazonS3" "x-amz-id-2" => "1vv/2RNBp9egndYkTjzbCBgQu0jk3AjpAZffR+firWM4Yzd6ilQxJnfKwKZVK8+N" "x-amz-request-id" => "9C1EC55648FB3ED9" } :local_address => “10.151.101.107”:local_port => 51335:reason_phrase =>“错误请求” :remote_ip => "54.231.232.1" :status => 400 :status_line => "HTTP/1.1 400 错误请求\r\n"
这是我的用户控制器:
class UsersController < ApplicationController
before_action :authenticate_user!
def update
if current_user.update_attributes(user_params)
flash[:notice] = "User information updated"
redirect_to edit_user_registration_path
else
flash[:error] = "Invalid user information"
redirect_to edit_user_registration_path
end
end
private
def user_params
params.require(:user).permit(:name, :avatar)
end
end
【问题讨论】:
-
您应该提供有关相应控制器方法的更多信息。
标签: ruby-on-rails