Questions and discussions about using the Shopify CLI and Shopify-built libraries.
So this is my Products controller
class ProductsController < AuthenticatedController
def index
@Anonymous = ShopifyAPI::Product.find(:all, params: { limit: 10 })
render(json: { products: @Anonymous })
end
end
And this is how I want to display the products in views/products/index.html.erb:
<h2>Products</h2>
<% @Anonymous.each do |p| %>
<p><%= p.title %></p>
<% end %>
And my route:
get '/products', :to => 'products#index'
But when I redirect my page to /products, I get this message:
Which doesn't happen with all my other routes, so what am I doing wrong? Am I missing something?