這是我users_controller.rb
代碼:在Rails中找不到視圖模板?
...
def edit
@user = @current_user
end
def update
@user = @current_user # makes our views "cleaner" and more consistent
if @user.update_attributes(params[:user])
flash[:notice] = "Account settings updated."
redirect_back_or_default account_url
else
render :action => 'edit'
end
end
...
我有以下幾點看法/用戶:
- new.html.erb
- password.html.erb
- profile.html.erb
- show.html.erb
每次我嘗試更新我的用戶帳戶設置,以下彈起:
ActionView::MissingTemplate (Missing template users/edit.erb in view path app/views:vendor/plugins/admin_data/app/views):
app/controllers/users_controller.rb:46:in `update'
這不是admin_data
故障是你是好奇。這是控制器。我做錯了什麼?謝謝。
我的用戶在「show.html.erb」中更新他們的詳細信息。我如何讓控制器保存並重定向到那裏?謝謝。 – Victor 2010-11-25 06:27:59