Sha256: 6cce82e7b5fc2d7980f217098409a2e60ac067d4fbff955020629ea72f9ef751
Contents?: true
Size: 433 Bytes
Versions: 1
Compression:
Stored size: 433 Bytes
Contents
# User and UserDecorator is an example with ActiveModel and Draper class User extend ActiveModel::Naming attr_accessor :status def self.status_options %w[ approved rejected ] end end class UserDecorator < Draper::Decorator decorates :user humanizes :status end class CustomUserDecorator < Draper::Decorator decorates :user humanizes :status def self.default_humanize(value) value.to_s.upcase end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
olson-0.0.3 | spec/fixtures/user.rb |