You show how to do russian doll caching on rails views, but how to do caching on vuejs template ?
If for example using Active Model Serializer, I have view with many dynamic parts in a view. So I was wondering if its better make one request and have all required information than many small single requests. Is it possible to cache ?
From docs There is currently a problem with caching in AMS Caching doesn't improve performance.
Great vid Chris. You mention that you could serialize the players in team, but rails needs it as a "_attributes" for the strong params. How would you handle another level of nesting - ie: if players had shoes. You couldn't set aside a separate object (as each player has shoes), so I think you'd need to serialize it? How would you handle that with your method above?
In that situation, I would probably just leave the JSON alone, serialize it with the wrong names, and then at the very end go through and rename those properties. You could do that on either side as well, in the JS or in the controller. It wouldn't really matter, but it might be easiest to do in JS.
Hi. I haven't watched the video, just sniped some code I needed. FYI, there's a typo: meta[name="csfr-token"] instead of csrf-token. Thanks!
I wrote a gem to load vue file into rails asset pipe, without install webpack or browserify ...
Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.