kuroda / vue-rails-form-builder

A custom Rails form builder for Vue.js
MIT License
80 stars 9 forks source link

Option to camelize object name and attributes #4

Open tiagocassio opened 6 years ago

tiagocassio commented 6 years ago

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.

kuroda commented 6 years ago

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

tiagocassio commented 6 years ago

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.

kuroda commented 6 years ago

Yes, I want to see it.

tiagocassio commented 6 years ago

Done. Checkout #5 PR!