我不明白我的rails应用程序如何在命令输出“rake routes”中找不到路径Edit_user_registration_path(usr)。
没有Entiendoporquémiaplicaciónrailno encuentra el path a Edit_user_registration_path(usr)cuando lo presenta rake routes en su salida。
THE routes.rb
resources :comentarios
resources :productos
resources :seudonimos
resources :configuraciones
resources :sociales
resources :clientespotenciales do
member do
get :confirmarsi
get :confirmarno
get :confirmarbaja
get :conocidos
end
collection do
get :altaunete
get :altaconocidos
get :confirmaunete
get :confirmacion
end
end
get 'unete', to: 'clientespotenciales#new', as: 'unete'
get 'altaunete', to: 'clientespotenciales#altaunete', as: 'altaunete'
get 'confirmaunete', to: 'clientespotenciales#confirmaunete', as: 'confirmaunete'
get 'confirmarcorreo', to: 'clientespotenciales#confirmacion', as: 'confirmacorreo'
resources :clipotcategorias
resources :usuarios do
member do
get :seudonimos, format: :json
end
end
get 'textos/lista'
resources :textos do
member do
get :leer
end
end
resources :categoriastextos
concern :the_role, TheRole::AdminRoutes.new
namespace :admin do
concerns :the_role
end
get 'web/index'
get 'web/admin'
get 'web/contacto'
get 'web/contactopublicidad'
get 'web/privacidad'
get 'web/avisocookies'
get 'web/avisolegal'
get 'web/contratoescritores'
get 'web/configuracion'
get 'web/textocontratoescritores'
get 'web/faq'
post 'contactopublicidad', to: 'web#contactopublicidad', as: 'contactopublicidad'
resources :web do
member do
get :setescritor
get :setlector
delete :borrarusuario
end
end
devise_for :users
日志
ActionController :: RoutingError(没有路由匹配[DELETE]“/users/edit.8”):
视图中的链接
<%= link_to'Borrar- nuevo',edit_user_registration_path(usr),方法:: delete,data:{confirm:'Estas seguro?' },class:“right admin_links”%>
设置路线注意:用户不再有路线显示佣金路线
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session GET /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
user_confirmation POST /users/confirmation(.:format) devise/confirmations#create
new_user_confirmation GET /users/confirmation/new(.:format) devise/confirmations#new
GET /users/confirmation(.:format) devise/confirmations#show
root GET / web#index
答案 0 :(得分:0)
您的link_to指定edit_user_registration_path(usr)
。试试user_registration_path(usr)
。
前者将删除users/edit.8
,这不是上面路径文件中的路径。您只有一个DELETE路径(users/8
)