ruby on rails - What if model doesn't match controller naming? -


say have setup:

my model 'content', , want use model in 2 controllers.

blog_controller.rb article_controller.rb

my 'content' model has property 'content_type' tells me if content 'blog' or 'article'.

this seems prevent me doing:

resources :article resources :blog

right? since models different? or can still this?

you can still it.

in routes file, resources method is, default, looking controller of same name pass it. regardless of model's name is, if have controller named blog_controller can resources :blog


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -