0

If I understand correctly :

  • The "Rails Way" to have controllers and views properly scaffolded , when model already exists, and when namespace is necessary (i.e. for the "admin" part) is this way : bin/rails scaffold_controller Admin::Locations --model-name=Location (reference here : https://stackoverflow.com/a/50010204/2595513, see comment of life_like_weeds). It works, but zero attributes are displayed in the generated index.html.erb and _form.html.erb

  • The "Rails Way" to have attributes printed out in scaffolded files in this way : rails g scaffold_controller User name:string email:string (see https://stackoverflow.com/a/39594505/2595513)

Now how do I mix both, in other words, how to get namespaced scaffold_controller to work with attributes that will be generated ?

bdavidxyz
  • 2,402
  • 1
  • 18
  • 31
  • 1
    The Rails scaffolds don't even do [namespace defintion properly](https://github.com/rubocop/ruby-style-guide#namespace-definition) so however you do it you'll have to do some manual work. – max Jan 07 '22 at 22:52

0 Answers0