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