What is a presenter?
When we're writing a web application, we often find ourselves struggling with trying to put display logic in the right place.
We have some logic that can either go on the model (or the domain object), but it can also go on the view.
For example, we might have a user with a first and a last name. We want to show the full name in a particular way, so we can write this logic on the domain object, but this means that it'll spread across the entire app. We can also write it directly on the view. But testing this will be a pain. Now we have to render an entire view to test that our name is properly formatted.
The best solution I found to this problem is writing a presenter. A presenter is an object that will sit between the model and the view. It will provide all the necessary logic to display anything we need without affecting either the model nor the view. And since it's just a regular object, it will be re-usable and easy to test.
About this course
I've written a gem that provides advanced presentation capabilities for your objects. It makes using presenters as simple as it can be.
In this course I'll show you how to build your own. You'll learn some basic programming concepts and techniques, as well as advanced Ruby features.
We'll talk about API design for a library and how to choose between different possibilities. We'll go in depth about all the choices that factor into taking the decisions that drive our design.
You'll be able to follow along and end up with your own presentation library ready to be used in production code. And, you'll be able to customize it as you please.
I'll be streaming the process of writing this course on my Twitch channel over the next few weeks. You're welcome to join me on this adventure and to follow me if you want to be notified whenever I go live.