Closed kasugaijin closed 1 month ago
Hi @kasugaijin, I can take up this issue. Can you please assign it to me? Thanks Nidhi
Hey @kasugaijin,
One quick question, are you also looking to add module custom_form for controller as well as we already have question route nested under forms
resources :forms do
resources :questions
end
Do you also want it to be nested under custom_form namespace which will become
resources :forms do
namespace :custom_form do
resources :questions
end
end
So, current URL will become from http://localhost:3000/alta/staff/forms/1/questions/1/edit to http://localhost:3000/alta/staff/forms/1/custom_form/questions/1/edit
Can you confirm on this?
Thanks Nidhi
So we will want to use CustomForm as a scope for all form related resources so please make it CustomForm::Form::…
thanks @sarvaiyanidhi
Thanks @kasugaijin .. Can I also make changes for Form to CustomForm::Form in this PR itself along with changes for CustomForm::Question?
Yes that makes sense to do in one PR. @sarvaiyanidhi Also, we will again refactor the SubmittedAnswer model you worked on recently as we have changed direction slightly architecturally and need that model to be more generalized to accept data from multiple inputs, not just the custom form. Just letting you know now in case you wonder why there will be an issue to change this :)
Sure.. Thanks for the heads up
Question should be renamed to CustomForm::Question. This means renaming all areas in the app (model, controller, policies, views, tests, variables, methods etc.). It should be a relatively straightforward find and replace.
Note the table does not need to be renamed. The CustomForm scope helps to organize this resource along with others that are similar.
please nest the modules and classes instead of inline: https://thoughtbot.com/blog/why-you-should-nest-modules-in-ruby we are trying to move to the nested format throughout.
Any questions - comment below!