Sha256: 928fb1030e46db2814e3effddb68a28e749db72ca82b44d9c2b8ac999c7d0125
Contents?: true
Size: 603 Bytes
Versions: 31
Compression:
Stored size: 603 Bytes
Contents
module Recruiter module ShowHelper def show_for(model, &block) if block_given? yield AttributeShower.new(model, self) end end class AttributeShower attr_reader :object, :helper def initialize(object, helper) @object = object @helper = helper end def show(attribute) render( object.class.human_attribute_name(attribute), object.send(attribute) ) end def render(label, value) helper.render('application/show_item', label: label, value: value) end end end end
Version data entries
31 entries across 31 versions & 1 rubygems