In most of my Shopify apps I end up having to write routes for
redirecting the user back to Shopify. Usually to the shop's admin
page, or the products, or orders pages. I kept adding to the list of
routes I would include in config/routes.rb, and it started getting
rather sloppy. So I wrote this gem so I could do this in my config/
routes.rb:
namespace :shopify do
ShopifyAPI.routes self, only: [:products, :orders]
end
Then I'd have these paths available to use in my app:
shopify_products_url
shopify_orders_url
The gem is published if anybody wants to use it. Just include shopify-
routes in your Gemfile. The code and docs are on Github here:
https://github.com/travishaynes/shopify-routes
It's really early in development. I haven't written the tests for it,
yet. The gem just kind of evolved naturally as I was writing other
apps, so any feedback would be appreciated!