简体   繁体   中英

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

I tried to add Devise to my Rails app. But somehow i have problems with my routes, i get:

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

In line 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?

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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