I have a simple application in which the user can manage decks of cards.
In my model I have:
- Card
- DeckOfCards
In my view /DeckOfCards/:id/edit
I want to allow the user to create a new card and add it to the current deck.
I currently have a form_for helper that posts to to /Cards/new
Should my Cards controller be hard coded to redirect back to DeckOfCards? What if later I want to create cards independently of a deck?
Another possible approach I am considering is a custom action on my DeckOfCards controller to handle this case. If I do that is there a way to use form helpers or does that require I post back to the associated controller for the object I am creating?
I am liking the structure that rails brings but when dealing with multiple entities it is not clear in my mind what the architecture should look like. I fear if I misuse these paradigms I will end up in a world of pain!
Can you recommend a more flexible way to approach this?
Thanks for any help