I'm building a shopify app-proxy using ruby on rails. i’m using the shopify_app gem.
in my controller actions i have the following set:
render layout: false, content_type: ‘application/liquid'
- so that the app is embedded within the shop’s layout/theme.liquid.
my question is how do i then pull assets into the app? I’ve tried including them manually into the template files using:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
but alas, i get 404 not found errors. currently i’m putting asset files into the store’s theme which doesn’t seem ideal.
Hey did you manage to figure this out? Could it have something to do with the way Rails fingerprints the assets?
EDIT (SOLVED): I was recieving 404s because the asset host domain was getting changed to the shopify store's domain. In order for Rails to find your assets you need to specify the domain in your production enviroment (production.rb):
config.action_controller.asset_host = "https://your-custom-domain-or-herokuapp-domain.com"
Hope this helps!