Sha256: fcf7e32926976e29834d71519198bc83e74edc492f83d0531b4b448dec1f2954

Contents?: true

Size: 608 Bytes

Versions: 7

Compression:

Stored size: 608 Bytes

Contents

class ApplicationDecorator < Draper::Decorator
  # Always use our custom PaginatingDecorator to decorate ActiveRelation
  # objects so we can properly delegate Kaminari's pagination extensions.
  def self.collection_decorator_class
    PaginatingDecorator
  end

  # 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]
  #       ...
  def haml_object_ref
    model.class.to_s.underscore
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.5.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.4.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.3.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.2.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.1.0 lib/stationed/generators/templates/application_decorator.rb
stationed-0.0.1 lib/stationed/generators/templates/application_decorator.rb