我想在has_many/belongs_to协会类似于此示例实现includes: class Author < ApplicationRecord
has_many :books, -> { includes :line_items }
end
class Book < ApplicationRecord
belongs_to :author
has_many
我正在尝试Rails 5.1中的Webpack的新支持来管理我的Vue应用程序。我目前不知道如何轻松访问CSRF令牌。从previous answers to this question建议似乎陷入类别: 使用ERB(即my-app.js.erb)嵌入form_authenticity_token Rails的助手到的JavaScript文件直接 使用jQuery来从页头具有CSRF的meta标签