views:

81

answers:

1

I want to generate the scaffold in a Rails app, generating the model as usual but having the controller inside the admin namespace. Is it possible?

+1  A: 

The first time I've done it, I run

script/generate scaffold blog

and then refactored the controller, views, etc. My prefered solution at the moment is:

script/generate scaffold admin::blog

and then refactor the model, unit test and migration; it's less work.

If there's a better answer, I'll accept it.

J. Pablo Fernández