这是我的 config/route.rb 的设计部分:
devise_for :admin_utilisateurs, :path_names => { :sign_up => 'enregistrer',
:sign_in => 'connexion',
:sign_out => 'deconnexion',
:password => 'mot_de_passe',
:unlock => 'deverouiller'},
:path => 'identification'
这导致以下结果rake routes
:
new_admin_utilisateur_session GET /identification/connexion(.:format) devise/sessions#new
admin_utilisateur_session POST /identification/connexion(.:format) devise/sessions#create
destroy_admin_utilisateur_session DELETE /identification/deconnexion(.:format) devise/sessions#destroy
admin_utilisateur_password POST /identification/mot_de_passe(.:format) devise/passwords#create
new_admin_utilisateur_password GET /identification/mot_de_passe/new(.:format) devise/passwords#new
edit_admin_utilisateur_password GET /identification/mot_de_passe/edit(.:format) devise/passwords#edit
PUT /identification/mot_de_passe(.:format) devise/passwords#update
cancel_admin_utilisateur_registration GET /identification/cancel(.:format) devise/registrations#cancel
admin_utilisateur_registration POST /identification(.:format) devise/registrations#create
new_admin_utilisateur_registration GET /identification/enregistrer(.:format) devise/registrations#new
edit_admin_utilisateur_registration GET /identification/edit(.:format) devise/registrations#edit
PUT /identification(.:format) devise/registrations#update
DELETE /identification(.:format) devise/registrations#destroy
admin_utilisateur_confirmation POST /identification/confirmation(.:format) devise/confirmations#create
new_admin_utilisateur_confirmation GET /identification/confirmation/new(.:format) devise/confirmations#new
GET /identification/confirmation(.:format) devise/confirmations#show
admin_utilisateur_unlock POST /identification/deverouiller(.:format) devise/unlocks#create
new_admin_utilisateur_unlock GET /identification/deverouiller/new(.:format) devise/unlocks#new
GET /identification/deverouiller(.:format) devise/unlocks#show
我该如何更改?例如,路线:
/identification/deverouiller/new
进入
/identification/deverouiller/nouveau
如果我添加:new => 'nouveau'
到:path_names
哈希中,那是行不通的。
非常感谢您的帮助