コントローラに、を介してオブジェクトをaccount_settings
更新するフォームがあります。エラーメッセージが通過していません。コードを見てみましょう。user
users_controller
account_settings / account.html.haml
= form_for @user, :url => { :controller => "users", :action => "update", :id => @user.id } do |f|
- if @user.errors.any?
.alert.alert-error
%h4
Please address the following errors:
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
form stuff...
account_settings_controller
def account
@user = current_user
end
users_controller
def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
flash[:notice] = "User was successfully updated."
end
redirect_to :back
end
フォームは更新されませんが、返されるエラーメッセージはありません。何かご意見は?