Skip to content
blizz edited this page Sep 12, 2010 · 4 revisions

polymorphic <name for=“[object]”>

<name> tag defined in rapid.dryml


<def tag="name"><%= if this.nil? nil_view else name_tag = find_polymorphic_tag("name") if name_tag != "name" send(name_tag) elsif this.is_a?(Array) && this.respond_to?(:proxy_reflection) count elsif this.is_a? Class and this < ActiveRecord::Base this.name.pluralize.titleize elsif (name_attr = this.class.try.name_attribute) && can_view?(this, name_attr) view(merge_attrs(attributes, {:field => name_attr})) elsif can_view?(this) this.to_s end end %></def>

Clone this wiki locally