Reputation: 31
I have a model already in place. I just want some admin screens created for it which will do the add/edit/update/delete functionality.
My model name is User and it has properties user_id, first_name, last_name, user_status, created_at, updated_at, updated_by
Is it possible to use the script/generate scaffold
on this model so that crud functionality would come on its own and then I can just make it look like rest of the application.
I dont know if it makes a difference but the user
model has a has_many through
relationship with another table
Upvotes: 3
Views: 625
Reputation: 476
Sounds like you simply need an admin controller + views for Users. You should strongly consider name-spacing the admin area (which is easily possible via the following generator in rails 3):
rails generate controller Admin::Users
additionally, if you also want the views generated, based on an existing User model:
rails generate scaffold_controller Admin::Users
Upvotes: 0