Class: ApplicationDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- ApplicationDecorator
- Defined in:
- lib/stationed/generators/templates/application_decorator.rb
Class Method Summary collapse
-
.collection_decorator_class ⇒ Object
Always use our custom PaginatingDecorator to decorate ActiveRelation objects so we can properly delegate Kaminari’s pagination extensions.
Instance Method Summary collapse
-
#haml_object_ref ⇒ Object
Override Haml’s default object notation to use the class name it would have used had an object not been decorated.
Class Method Details
.collection_decorator_class ⇒ Object
Always use our custom PaginatingDecorator to decorate ActiveRelation objects so we can properly delegate Kaminari’s pagination extensions.
4 5 6 |
# File 'lib/stationed/generators/templates/application_decorator.rb', line 4 def self.collection_decorator_class PaginatingDecorator end |
Instance Method Details
#haml_object_ref ⇒ Object
Override Haml’s default object notation to use the class name it would have used had an object not been decorated.
This removes the need for markup like:
%div[person.person]
...
Instead allowing:
%div[person]
...
20 21 22 |
# File 'lib/stationed/generators/templates/application_decorator.rb', line 20 def haml_object_ref model.class.to_s.underscore end |