Sha256: fa4f5fa1baacd100d555bb91a6f845315d1f9e03da123a9e02077644d4276cf3
Contents?: true
Size: 917 Bytes
Versions: 13
Compression:
Stored size: 917 Bytes
Contents
# frozen_string_literal: true module Magicka # @api public # # Basic class for elements for forms class FormElement < Element with_attribute_locals :field, :label with_attributes :model with_locals :ng_errors, :ng_model template_folder 'templates/forms' private # @api private # @private # # Label to be shon near the input # # when no label is provided, the name of # the field is used # # @return [String] def label @label ||= field.to_s.capitalize.gsub(/_/, ' ') end # @api private # @private # # ng model to be represented with the input # # @return [String] def ng_model [model, field].join('.') end # @api private # @private # # ng errors to be exposed with the input # # @return [String] def ng_errors [model, :errors, field].join('.') end end end
Version data entries
13 entries across 13 versions & 1 rubygems