Removing controller boiler plate in Phoenix
A nice little helper snippet for people who find themself wasting time writing boilerplate for catching “none of my functions matches” in controller actions.
Using this snippet you can safely write:
def some_action(conn, %{"myparam" => myparam}) when is_binary(myparam) do
without having to make a catchall function matching (conn, _)
to match the non-valid uses of your action.