Quick q on script/generate scaffold


#1

I want a scaffold to manager both products and users. To get the
products scaffold I used

script/generate scaffold Product Admin

if I use,

script/generate scaffold User Admin

will it overwrite my product admin controller? Would I be better off
doing

script/generate scaffold User User_Admin or something?


#2

Hello Vince,

doing

script/generate scaffold User User_Admin or something?

You can create a ProductController and a UserController
in an admin module :

script/generate scaffold Product admin/product
script/generate scaffold User admin/user

-- Jean-François.

#3

Jean-François wrote:

You can create a ProductController and a UserController
in an admin module :

script/generate scaffold Product admin/product
script/generate scaffold User admin/user

-- Jean-François.

Thanks for the quick reply. Since I have already done a script/generate
scaffold Product Admin should I undo it (script/destroy) or should I
just execute the second command (script/generate scaffold User
admin/user).

By the way, is this case sensitive?


#4

You can create a ProductController and a UserController
in an admin module :

script/generate scaffold Product admin/product
script/generate scaffold User admin/user

I’ve done this same process but ran into an error when trying to
view the page…

localhost/admin/product and localhost/admin/user return errors
and an empty website.

I also have an admin controller setup to help navigate the site
and act as the main page…

The question is, I am not sure if I need the admin controller.

Im still fairly new to rails and not sure if the directory and
file hierarchy requires me to have one.