ユーザーの詳細を編集するフォームを送信しようとすると、このエラーが発生します。Rails 3.2.7 を使用しています。これが私のコントローラーです
class UsersController < ApplicationController
def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @users }
end
end
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @user }
end
end
def new
@user = User.new
end
def edit
@user = User.find(params[:id])
end
def create
@user = User.new(params[:user])
if @user.save
sign_in @user
flash[:success] = "Welcome to the app!"
redirect_to welcome_path
else
render 'new'
end
end
def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
sign_in @user
flash[:success] = "Profile updated"
redirect_to welcome_path
else
render 'edit'
end
end
def destroy
@user = User.find(params[:id])
@user.destroy
respond_to do |format|
format.html { redirect_to users_url }
format.json { head :no_content }
end
end
end
そしてフォーム:
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<p><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</p>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="box">
<%= f.label :email %>
<%= f.text_field :email, class:"input_text" %>
<br>
<%= f.label :"edit password" %>
<%= f.password_field :password, class:"input_text" %>
<br>
<label>
<br>
<%= f.submit "Save", class: "button", name: "button" %>
</label>
</div>
<% end %>
Rake ルートの出力:
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
他に投稿すべきものがあれば教えてください...事前に感謝します