MVC design question
My current implementation is working, but wondering if there is a design approach that better conforms to rails standards to accomplish the following:
I have a model "ContractTemplate" that represents boilerplate terms for a business contract.
I have a model ClientContracts that represents executed contracts with clients.
Requirements
1. A user (lawyer) can edit a ContractTemplate record, make modifications and then the modified version is used to create a new ClientContract record without changing the original template. (No attachments, all JSON.)
2. A user edits the contract template and saves changes to the template.
I've made this work by creating a secondary edit flow for ContractTemplates and sending the save action to
My concerns
Sending an edit action to the create action in a different controller feels like bad design.
But, creating a helper method, or service to replicate a standard controller action (create) seems like bad design also.
I have a model "ContractTemplate" that represents boilerplate terms for a business contract.
I have a model ClientContracts that represents executed contracts with clients.
Requirements
1. A user (lawyer) can edit a ContractTemplate record, make modifications and then the modified version is used to create a new ClientContract record without changing the original template. (No attachments, all JSON.)
2. A user edits the contract template and saves changes to the template.
I've made this work by creating a secondary edit flow for ContractTemplates and sending the save action to
account_contacts#new.
My concerns
Sending an edit action to the create action in a different controller feels like bad design.
But, creating a helper method, or service to replicate a standard controller action (create) seems like bad design also.
Just found this gorails tutorial that walks through creating multiple submit buttons on a forms with different actions.
https://gorails.com/episodes/forms-with-multiple-submit-buttons
https://gorails.com/episodes/forms-with-multiple-submit-buttons
Notifications
You’re not receiving notifications from this thread.