简体   繁体   English

没有路线匹配{:controller =>“ devise / dokumente”}

[英]No route matches {:controller=>“devise/dokumente”}

I tried to add Devise to my Rails app. 我试图将Devise添加到我的Rails应用程序中。 But somehow i have problems with my routes, i get: 但是以某种方式我的路线有问题,我得到:

 No route matches {:controller=>"devise/dokumente"}

In line 21: 在第21行:

  <li><%= link_to 'Dokumente', controller: 'dokumente', action: 'index' %></li>

I tried several things like: 我尝试了几种方法:

  dokumente_path 

But then i get the error: 但是然后我得到了错误:

  No route matches {:action=>"show", :controller=>"dokumente"}

Because i have only the action/view index. 因为我只有动作/视图索引。

What should i change in my routes so that dokumente_path goes to dokumente index? 我应该在路线中进行哪些更改,以便dokumente_path进入dokumente索引?

My routes: 我的路线:

 resources :dokumente do
  collection do
   get :set_image
  end
 end  

   get "dokumente/index"
   post "dokumente/index"

Try: 尝试:

<li><%= link_to 'Dokumente', dokumente_index %></li>

Or, if you want dokumente_path , add this to your routes: 或者,如果您需要dokumente_path ,请将其添加到您的路线中:

  get "dokumente/index", :as => 'dokumente_path'
  post "dokumente/index", :as => 'dokumente_path'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM