Refactoring Phoenix controllers

General News

Summary

Plug is a library that Phoenix build on top of, and it provides basic interface to deal with HTTP requests and web servers in Elixir applications. Whenever your controllers become bloated, and you have multiple helper functions in them - good idea may be to move the business logic to separate modules. Our controller is not concerned with generating token, sending e-mails nor dealing with database - it delegates all the hard work to dedicated workflow, while being focused on being a bridge between framework and your business logic. This can be as simple as right-clicking in Chrome on the page, going to Developer Tools and writing a single line of code to our HTML form: There are several ways to deal with that. While the solution with multiple changesets is okay, I like to introduce custom, tableless schemas to take care of parameters filtering and validation.

Classifications

industries
No industries detected
applications
Web and Content Management

AskAI Classifications

Labels
Developer Tools DevOps Software SaaS

Linked Companies

GitHub, Inc.
$1M to $5M