Topic: View/Controller that needs to handle multiple "steps"
Time to up the difficulty of the applications I am building. Here are the details:
I want to build a new "user". This user has regular attributes (name, login, password etc.). This user also has "permissions" to access certain items. When creating this user I also want to be able to set "feature_permissions" to allow this user to have access to certain features.
So, there are three different models that this user creation process needs to touch. I want to be able to create this user in a three step process:
step 1: Set the default user values
step 2: Set the permissions for the items for this user
step 3: Set the feature permissions for this user
I also don't want to have partially created users in the database, so I don't want to write this information to the database until step 3 is completed.
Now, I don't want to create messy code by having a single "user" controller that does CRUD functions on three (seemingly) different things. The obvious way to attack this is to have a "user" controller, a "item_permissions" controller, and a "feature_permissions" controller, but I am not totally sure how to link them together so that the information persists between the three controllers and then at the end of step three, be able to write the information to the proper tables in the database.
Advice would be appreciated.