私はルートを理解するのがとても難しいです。誰かが私を助けてくれることを願っています。Rails:カスタムコントローラアクションへのルート
は、ここに私のカスタムコントローラ
class SettingsController < ApplicationController
before_filter :authenticate_user!
def edit
@user = current_user
end
def update
@user = User.find(current_user.id)
if @user.update_attributes(params[:user])
# Sign in the user bypassing validation in case his password changed
sign_in @user, :bypass => true
redirect_to root_path
else
render "edit"
end
end
end
だと私は
get "settings/edit"
が動作しないファイルの設定/ edit.html.erbと私のリンク
<li><%= link_to('Settings', edit_settings_path) %></li>
ルートを持っていますこれのために、私は得るから
undefined local variable or method `edit_settings_path' for #<#<Class:0x00000001814ad8>:0x00000002b40a80>
これはどのようなルートですか?私はそれを理解することはできません。私が代わりにパスの「/設定/編集」を置けば、それは、すぐにリソース名が
Thxを
最初にあなたが試した経路を教えてください – rubish
私の質問 – Mexxer