vue-rails-form-builder
vue-rails-form-builder copied to clipboard
Option to camelize object name and attributes
Hi, first of all, i want to say thank you for this great project!
I would like to camelize object name and attribute names to standard Javascript attribute sintax.
Ex.:
Instead this:
v-model="my_model.my_attribute"
I want to render this:
v-model="myModel.myAttribute"
What method in this gem does the insertion of "v-model" tag inside the form?
Thanks for all.
Thank you for being interested in my gem.
I have to think carefully about your proposal, because it breaks existing projects that adopt this gem.
For your question, see:
https://github.com/kuroda/vue-rails-form-builder/blob/03cb4abb92eeb9352bbdb02d33b83e85c53a1c72/lib/vue-rails-form-builder/vue_options_resolver.rb#L42-L49
I've added a option to camelize object and attribute names into vue_form_with and vue_form_for method with default: false to allow this. If you want to see, i can make a pull request.
Yes, I want to see it.
Done. Checkout #5 PR!