Skip to main content

Using VueJS for Nested Forms in Rails: Part 2 Discussion

General • Asked by Chris Oliver
Why did not you use "Vue.http.headers.common['X-CSRF-Token'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content')" ?
I believe he goes over that in Part 1 of the series.

This is a great series, Chris. Very helpful. It would be great if you could do a tutorial that uses Vue inside 'form_for' or 'form_with'. Most of the Vue Rails form tutorials out there use a basic HTML form and I'd love to drop Vue into small areas of the form without overhauling everything.

Hi Chris,
For more deeply nested forms, would you recommend using something like JBuilder to properly format the JSON and pass it to Vue?
Thanks for the great vids! I'd love to see more Vue with Rails videos. I'm loving the framework.

This comment since june/2016. Still there is no tutorial about "deep" nested_attributes and vue tutorial for rails. (like: team/player/football_shoes[:size, color, brand]) until 2 months i am trying to found a way for it. :(

So while this is awesome, it's also very inconvenient to go putting all this code in a single vue file... how can we move this functionality into components like shown in the Vue.js components episode?

Is there any tutorial about visual error handling of forms (after post and put)?
Now all fails silently...
Thanks Chris.

Hello all!

While using this technique, a came across a problem.

Im basically building an invoice with various fields calculations and nested items, all works fine.

In my form, one of the values is a select box, this helps with some calculations and changes the output of total depending, using computed properties, I then save all of those variables/values to the database on submit.

The problem is when I try then to edit the same record, its opens but the correct saved select values are not show, which will mess the whole calculation.

Any ideas anyone?



Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.