Search code examples
ruby-on-railsruby-on-rails-5shopifyshopify-app

Why are my Rails helpers not working with shopify_app gem?


I upgraded the shopify_app gem in my Shopify application from 7.x to 8.x and rails helpers stopped working properly.

What's going on?


Solution

  • Inheriting from ShopifyApp::AuthenticatedController in the controller hierarchy used to work.

    As of shopify_app gem version 8 the Rails helpers seem to break, at least in some cases.

    Instead of inheriting from the ShopifyApp::AuthenticatedController (which remains in the gem for backwards-compatibility) you can include the ShopifyApp::Authenticated concern. This should make the helpers work again. From the example app:

    class AuthenticatedController < ApplicationController
      include ShopifyApp::Authenticated
    end
    

    More info in the gem documentation.

    If that does not work or isn't an option for you, this medium post has another approach for including helpers.