Last active
October 8, 2018 03:37
-
-
Save Ninigi/1ad421e927243fe61e927e5d62ae3a38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule UselessWeb.ShopController do | |
# ... | |
def new(conn, %{"hmac" => _, "shop" => shopify_domain}) do | |
shop = ShopifyApp.find_shop_by(%{shopify_domain: shopify_domain}) | |
conn | |
|> put_layout({UselessWeb.EmbeddedAppView, "layout.html"}) | |
|> render("show.html", shop: shop) | |
end | |
def new(conn, %{"shop" => shop_name}) when is_bitstring(shop_name), | |
do: signup(conn, %{"shop" => %{"shopify_domain" => shop_name}}) | |
def new(conn, _params) do | |
changeset = ShopifyApp.change_shop(%Shop{}) | |
render(conn, "new.html", changeset: changeset) | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment