Sha256: 883ca4fc92c82829408db3a19236d74c9f4f6a2ccebab9634eeb5f65237b6f05

Contents?: true

Size: 840 Bytes

Versions: 33

Compression:

Stored size: 840 Bytes

Contents

<!-- Renders a human readable name of a collection

Use this tag for en locale only. Use human-collection-name for i18n.

### Details

 - Uses `this.origin_attribute` as the name.
 - Falls back to `<type-name>` otherwise.
 - By default the name is titleised and plural.

### Attributes

 - singular: singularise the name
 - lowercase: render the name in all lower case
 - dasherize: render the name in lower case with dashes instead of spaces.

-->
<def tag="collection-name" attrs="singular, lowercase, dasherize"><%=
  if (attr = this.try.origin_attribute)
    name = attr.to_s
    name = dasherize ? name.underscore.dasherize : name.titleize
    name = name.singularize if singular
    name = name.downcase if lowercase
    name
  else
    type_name(:plural => !singular, :lowercase => lowercase, :dasherize => dasherize)
  end
%></def>

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
hobo_rapid-2.2.6 taglibs/views/collection_name.dryml
hobo_rapid-2.2.5 taglibs/views/collection_name.dryml
hobo_rapid-2.2.4 taglibs/views/collection_name.dryml
hobo_rapid-2.2.3 taglibs/views/collection_name.dryml
hobo_rapid-2.2.2 taglibs/views/collection_name.dryml
hobo_rapid-2.2.1 taglibs/views/collection_name.dryml
hobo_rapid-2.2.0 taglibs/views/collection_name.dryml
hobo_rapid-2.1.2 taglibs/views/collection_name.dryml
hobo_rapid-2.1.1 taglibs/views/collection_name.dryml
hobo_rapid-2.1.0 taglibs/views/collection_name.dryml
hobo_rapid-2.1.0.pre4 taglibs/views/collection_name.dryml
hobo_rapid-2.1.0.pre3 taglibs/views/collection_name.dryml
hobo_rapid-2.1.0.pre2 taglibs/views/collection_name.dryml
hobo_rapid-2.1.0.pre1 taglibs/views/collection_name.dryml
hobo_rapid-2.0.1 taglibs/views/collection_name.dryml
hobo_rapid-2.0.0 taglibs/views/collection_name.dryml
hobo_rapid-2.0.0.pre10 taglibs/views/collection_name.dryml
hobo_rapid-2.0.0.pre9 taglibs/views/collection_name.dryml
hobo_rapid-2.0.0.pre8 taglibs/views/collection_name.dryml
hobo_rapid-2.0.0.pre7 taglibs/views/collection_name.dryml