{"id":70,"date":"2019-12-26T19:21:17","date_gmt":"2019-12-26T19:21:17","guid":{"rendered":"https:\/\/emersoncode.com\/blog\/?p=70"},"modified":"2019-12-26T19:21:17","modified_gmt":"2019-12-26T19:21:17","slug":"use-ruby-on-rails-app-helpers-with-shopify_gem","status":"publish","type":"post","link":"https:\/\/emersoncode.com\/blog\/use-ruby-on-rails-app-helpers-with-shopify_gem\/","title":{"rendered":"Use Ruby on Rails App Helpers with shopify_gem"},"content":{"rendered":"\n<p>If you&#8217;re reading this, you&#8217;re probably confused why the helper functions in helpers\/application_helper.rb aren&#8217;t working within your Shopify app.<\/p>\n\n\n\n<p>My favorite fix for this is to add a small snippet of code to config\/application.rb:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">config.to_prepare do\n   ShopifyApp::AuthenticatedController.helper ShopifyRoRAppName::Application.helpers\nend<\/code><\/pre>\n\n\n\n<p>It is very important to replace the ShopifyRoRAppName with your own RoR app&#8217;s name. For reference, it should be right above where you place the code:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"708\" height=\"163\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/12\/AppHelperFix.png\" alt=\"\" class=\"wp-image-71\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/12\/AppHelperFix.png 708w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/12\/AppHelperFix-300x69.png 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re reading this, you&#8217;re probably confused why the helper functions in helpers\/application_helper.rb aren&#8217;t working within your Shopify app. My favorite fix for this is to add a small snippet of code to config\/application.rb: It is very important to replace the ShopifyRoRAppName with your own RoR app&#8217;s name. For reference, it should be right above [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/70"}],"collection":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":1,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}