Pass data from Rails views to VueJS components in webpacker
问题 I'm trying to fiddle with Rails 5.1's new webpacker gem, along with VueJS, but can't get my erb views to pass data to VueJS components... Let's say I have a user show view # view/users/show.html.erb <%= javascript_pack_tag "user-card" %> <%= content_tag :div, id: "user-card", data: { username: @user.name } do %> <% end %> And my javascript: // app/javascript/packs/user-card.js require("user-card") // app/javascript/user-card/index.js import Vue from 'vue/dist/vue.esm' import UserCard from '.