Eduard Garcia


1,660 Experience
16 Lessons Completed
0 Questions Solved


I'm trying to figure out a way to reduce the complexity of passing a JSON to a Vue.js component.
Currently I've got something like this placed on a model scope,

  scope :to_vue, -> (id) {where(team_id: id).order(position: :asc).to_json(
      only: [:id, :name, :position, :team_id], include: {
          postits: {
              include: [:user, comments: {
                  include: :actor

Anyone know a better way to create a Json format without all that amount of includes?

Thanks for your answers.

Posted in Vue.js Trello Clone in Rails - Part 8 Discussion

Really great stuff! going trhough the whole series it really helps to understand the power of vue as well as vuex and how both simplifies the way of dealing with data passing though components. Just want to go deeper into it now.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.