mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Travis trigger :)
This commit is contained in:
parent
a1d16cbfa7
commit
203910c6dd
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ This gem makes it easy to apply the decorator pattern to domain models in a Rail
|
|||
|
||||
### 1. Object Oriented Helpers
|
||||
|
||||
Why hate helpers? In Ruby/Rails we approach everything from an Object-Oriented perspective, then with helpers we get procedural.The job of a helper is to take in data and output a presentation-ready string. We can do that with a decorator.
|
||||
Why hate normal helpers? In Ruby/Rails we approach everything from an Object-Oriented perspective, then with helpers we get procedural.The job of a helper is to take in data and output a presentation-ready string. We can do that with a decorator.
|
||||
|
||||
A decorator wraps an object with presentation-related accessor methods. For instance, if you had an `Article` object, then the decorator could override `.published_at` to use formatted output like this:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue