diff --git a/index.html b/index.html index 871a21e..68fd6af 100644 --- a/index.html +++ b/index.html @@ -8,14 +8,17 @@

Projects

View Models

+

Silly Tagline

The missing glue between the letters in ruby on rails' MVC.

+

But why? Let me tell you a story of high adventure

During writing a music community platform with multiple different profile types – in our case bands, normal members, venues, and labels – it occurred to us that type specific methods were hard to place. As a simple example the displayed name.

For bands that needed to be just the band name, for members the name and surname, for labels the name along with the amount of bands under contract.

First, we tried putting it into models, but that violated the MVC principle, we didn't feel to good about sticking view code into the model. Besides, all view helpers were pretty inaccessible.

Even after sticking the code into a helper, thus into the view, this didn't feel much better either, as we had to check for the type of the model. That resulted in case statements which we do not speak about too much nowadays. Even bringing it up here caused me to cringe.

So, where to put this view specific, model-type dependent code?

-

Enter view models, the public face of the normally shy models:

- Repository +

Enter view models, the public face of the normally shy models.

+

Repository

+ Check them out here

Contexts

Repository