<%= raise Hobo::PermissionDeniedError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}" unless force || can_view? res = if this.nil? && if_blank.nil? this_type.is_a?(Class) && this_type <= String ? "" : nil_view elsif (refl = this_field_reflection) && refl.macro == :has_many collection_view(attributes) else view_tag = find_polymorphic_tag("view") if view_tag == "view" # i.e. it didn't find a type specific tag if this.respond_to?(:to_html) this.to_html(scope.xmldoctype) else this.to_s end else attrs = add_classes(attributes, "view", type_and_field._?.dasherize, model_id_class) view_attrs = attrs_for(view_tag) the_view = send(view_tag, attrs & view_attrs) the_view = if_blank if if_blank && the_view.blank? truncate = 30 if truncate == true the_view = self.truncate(the_view, :length => truncate.to_i) if truncate the_view = the_view.html_safe? ? the_view.strip.html_safe : the_view.strip if no_wrapper the_view else wrapper = if inline :span elsif block || this_type <= HoboFields::Types::Text :div else :span end element(wrapper, attrs - view_attrs, the_view) end end end Dryml.last_if = !res.blank? res %>