How To Display Heroku Hosted Ruby On Rails Shopify App Page On Shopify Storefront
I have a Ruby on Rails public embedded Shopify app hosted on Heroku. I am trying to get pages from my app to appear on the front end of my Shopify store by way of an application proxy. I have already set the application proxy configurations in my app settings, but the only pages I can get to display are the files that are in the public folder of my app. However, they are not embedded within the Shopify theme.
I can't modify an .htaccess file to set the content-type to application/liquid because the app is hosted on Heroku. I tried rendering the file using a controller action and setting the content-type there:
def send filename = File.join(Rails.root, "/public/test.html") send_file(filename, :filename => "test.html", :type => 'application/liquid', :disposition => "inline") end
but controllers don't seem to be recognized by the app proxy at all. As such, I can't use a controller to render an html.erb file either. How exactly am I supposed to get html.erb pages (or html pages) from my rails app to show up within my shopify theme?
I got it working. There were a couple of issues with my setup. The send action worked when used in a Shopify controller (ShopifyApp::AuthenticatedController), but the very same action returned a 'wrong number of arguments (given 1, expected 0)' error when used in a controller that inherited from ApplicationController. The fix there was to make arguments optional for the action. I changed 'def send' to 'def send(blank=nil)'. Also, I was sending an html file instead of a liquid file.
- → Trigger a click with jQuery using link_to of rails 4
- → Adding html data attribute to simple_forms input
- → How to remove parameters from the root URL if it does I18n
- → passing parameters to rails back end from an ajax call
- → Blocking ?page= in robots.txt
- → react js and rails Updating state on a component with active record relationship
- → State not passed into prop
- → Cannot read property 'modalIsOpen' of undefined
- → Objects not valid issue
- → How to map API params to model
- → Consuming webhooks shopify-api
- → How to add ScriptTag on shopify_api gem?