I'm developing a new Shopify App. It's already installed. I'm developing on Shopify API 7.2.0 and Ruby 5.
So I'm trying to attach a javascript file on frontpage.
That's my code on app > controllers > 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
That's the only way I found to work.
If I include just one ss = ShopifyAPI::ScriptTag.create({:src => "https://.../script.js", :event => 'onload'})
it does not attach.
What am I doing wrong? I didn't find documentation about it.