私はMichaelHartlによるRubyonRailsチュートリアルに取り組んできました。現在、ユーザー属性のいずれかを編集するには、ユーザーは自分のパスワードを確認する必要があります。これを行わずにユーザー属性を更新する方法はありますか?
私のフォームは次のようになります。
<%= form_for @user do |f| %>
<div class="field">
<%= f.label :course1 %><br />
<%= f.text_field :course1 %>
</div>
<div class="actions">
<%= f.submit "Update" %>
</div>
<% end %>"
そしてusers_controller.rbの私の更新定義は次のようになります:
def update
if @user.update_attributes(params[:user])
flash[:success] = "Edit Successful."
redirect_to @user
else
@title = "Edit user"
render 'edit'
end
end
現在、update_attributesアクションは失敗します。
ありがとう!