Rails routing error - uninitialized Constant

Asked

Viewed 107 times

0

Guys, I created an application in Rails and managed some models, controllers etc. As follows:

rails g scaffold nivelIntermediario/Historia descricao:string

My route file looked like this:

namespace :nivel_intermediario do
   resources :historias
end

And my controller like this:

class NivelIntermediario::HistoriaController < ApplicationController

There every time having access to create a new story appears this error:

uninitialized constant NivelIntermediario::CartasController

Follows the routes:

nivel_intermediario_historias GET    /nivel_intermediario/historias(.:format)          nivel_intermediario/historias#index
                                  POST   /nivel_intermediario/historias(.:format)          nivel_intermediario/historias#create
 new_nivel_intermediario_historia GET    /nivel_intermediario/historias/new(.:format)      nivel_intermediario/historias#new
edit_nivel_intermediario_historia GET    /nivel_intermediario/historias/:id/edit(.:format) nivel_intermediario/historias#edit
     nivel_intermediario_historia GET    /nivel_intermediario/historias/:id(.:format)      nivel_intermediario/historias#show
                                  PATCH  /nivel_intermediario/historias/:id(.:format)      nivel_intermediario/historias#update
                                  PUT    /nivel_intermediario/historias/:id(.:format)      nivel_intermediario/historias#update
                                  DELETE /nivel_intermediario/historias/:id(.:format)      nivel_intermediario/historias#destroy

1 answer

0

One thing, inside the controllers you must have a folder nivel_intermediario and inside it the file historias_controller.Rb.

You can send a print of your controllers folder?

  • It seems to me that your answer is more to a comment, you could improve your answer in order to solve the cited problem ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.