<%= if attributes[:type] element :input, deunderscore_attributes(attributes), nil, true, true else no_edit ||= :view no_edit = no_edit.to_sym no_edit_permission = !can_edit? unless no_edit == :ignore if no_edit_permission && no_edit == :view view(attributes) elsif no_edit_permission && no_edit == :skip "" else attrs = attributes attrs = add_classes(attrs, type_id.dasherize, type_and_field.dasherize) unless type_id.nil? || type_and_field.nil? attrs[:name] ||= param_name_for_this attrs[:disabled] = true if no_edit_permission && no_edit == :disable the_input = if (refl = this_field_reflection) if refl.macro == :belongs_to call_polymorphic_tag('input', attrs) or select_one(attrs) elsif refl.macro == :has_many if refl.options[:through] collection_input(attrs) else input_many(attrs) end end else call_polymorphic_tag('input', attrs) or (call_polymorphic_tag('input', HoboFields.to_class(this_type::COLUMN_TYPE), attrs) if defined?(this_type::COLUMN_TYPE)) or raise Hobo::Error, ("No input tag for #{this_field}:#{this_type} (this=#{this.inspect})") end unless this_parent.nil? || this_parent.errors[this_field].empty? "#{the_input}".html_safe else the_input end end end %>