2016-10-14 2 views
1

新しいShopifyアプリケーションを開発しています。すでにインストールされています。私はShopify API 7.2.0とRuby 5で開発中です。Shopify ScriptTagが正しく動作しません

私はフロントページにjavascriptファイルを添付しようとしています。

私は仕事に見つけた唯一の方法だアプリ>コントローラ> home_controller.rb

 
class HomeController ... ShopifyApp::AuthenticatedController 
    def index 
    ss = ShopifyAPI::ScriptTag.create({:src => "https://.../script.js", :event => 'onload'}) 
    end 
    def script 
    ss = ShopifyAPI::ScriptTag.create({:src => "https://.../script.js", :event => 'onload'}) 
    end 
end 

に私のコードです。

ss = ShopifyAPI::ScriptTag.create({:src => "https://.../script.js", :event => 'onload'})を1つだけ含めると添付されません。

私は間違っていますか?私はそれに関する文書を見つけられませんでした。

答えて

1

あなたが宝石

https://github.com/Shopify/shopify_api

に記載されている手順に従わなかったように私はあなたの店に「接続」傾けるようあなたがセッションを設定していないと仮定見えます。
あなたがヴァリデセッションを持っていることを確認し、それが動作します

enter image description here

関連する問題