get "user/new"Railsのroutes.rbでは、 vsの違いは何ですかget "user#new"
1 に答える
1
私が知っていることから:
get "user/new"
は、URL をいつ入力するかを意味します。アクションlocalhost/user/newによって処理されます。users controllernew
"user#new"
特定の URL を特定のcontrollerandactionで処理したい場合に使用します。たとえば、開くときにactionlocalhost/profilesで処理したい場合などです。users_controllershow
get "profile", to: "users#show"
または、localhost/edit_profile:
get "edit_profile", to: "users#edit
于 2013-08-05T10:44:17.073 に答える