Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Bypassing GitHub's OAuth Flow with a Head Request. Parent comment
def profile(conn = %{method: "GET"}, params) do # ... end def profile(conn = %{method: "POST"}, %{"user" => user_params) do # ... end
get "/profile", UserController, :profile, as: :user post "/profile", UserController, :profile, as: :user
The above seems like the natural way to do it with Phoenix once you get a hang of pattern matching.
The above seems like the natural way to do it with Phoenix once you get a hang of pattern matching.