ruby on rails を使って mws api で製品を投稿しようとしています。ただし、常に次のメッセージが表示されます。
undefined method `sku' for #<Spree::Admin::MeController:0xce1cec0>
require 'mws-connect'
class Spree::Admin::MeController < Spree::Admin::ResourceController
def index
mws = Mws.connect(
merchant: 'merchant',
access: 'access',
secret: 'secret'
)
sku = '12345678'
product = Mws::Product sku {
upc '123435566654'
tax_code 'GEN_TAX_CODE'
name 'Some Product 123'
brand 'Some Brand'
msrp 19.99, 'USD'
manufacturer 'Some Manufacturer'
category :ce
details {
cable_or_adapter {
cable_length as_distance 5, :feet
}
}
}
submission_id = mws.feeds.products.add(product)
result = mws.feeds.get(submission_id)
puts "Submission: #{result.transaction_id} - #{result.status}"
end
誰かが私を助けることができますか?