lib/generator/lib/app.rb in shopify-sinatra-app-0.1.3 vs lib/generator/lib/app.rb in shopify-sinatra-app-0.1.4
- old
+ new
@@ -10,11 +10,11 @@
# Your App's Home page
# this is a simple example that fetches some products
# from Shopify and displays them inside your app
get '/' do
shopify_session do
- @products = ShopifyAPI::Product.find(:all, :params => {:limit => 10})
+ @products = ShopifyAPI::Product.find(:all, params: { limit: 10 })
erb :home
end
end
# this endpoint recieves the uninstall webhook
@@ -35,17 +35,16 @@
shopify_session do
# create an uninstall webhook, this webhook gets sent
# when your app is uninstalled from a shop. It is good
# practice to clean up any data from a shop when they
# uninstall your app.
- uninstall_webhook = ShopifyAPI::Webhook.new({
- topic: "app/uninstalled",
+ uninstall_webhook = ShopifyAPI::Webhook.new(
+ topic: 'app/uninstalled',
address: "#{base_url}/uninstall",
- format: "json"
- })
+ format: 'json'
+ )
uninstall_webhook.save
end
redirect '/'
end
-
end