I've create a Ruby on Rails app using the shopify_app gem which is being hosted on heroku. It is a simple form that queries a pg database and returns a table of results posted to the same path. It works perfectly on heroku but I'm trying to figure out why on my shopify site's proxy, only the initial get request for the path works but when it tries to render the view with the search results post requested to the same path, shopify says 'page not found'. Here is a link to the app on heroku: https://rails-test-app4.herokuapp.com/proxy-test and the app on shopify: https://deltachildren-content.myshopify.com/apps/proxy-test
1 Answers
From our discussion in the comments, I understand this (do correct me if I am wrong):
- You have setup an app on Heroku and you're using it to control the data from your Shopify store.
- You've setup an app proxy on Shopify with /apps/* path and linked it to the app on Heroku.
- You're able to retrieve (GET) information on to the app (say webpage) but you're unable to post new or modify the information (POST/PUT/DELETE).
That's not how an app proxy works. App proxy is used for get the information from the original app and then pass it through Shopify servers, render any liquid code and display it to the user. More details on it here - Application Proxies: The New Hotness
Retrieving information is fairly straight forward as long as it is within the formal limits (basic information that don't require API authentication) of the Shopify or third-party external sites (bypassing CORS and iframe issues). If you want to get more detailed information you need to make RESTful calls from you app on Heroku to Shopify store.
There are specific guides for each API endpoint required and how to implement them using Ruby on Rails, but here's a direction to start at - How to get to everything using Ruby on Rails
Hope it helps.
https://MyApiKey:[email protected]
– HymnZzy