% # attachment = attribute.split('_file_name').first if !@item.class.validators.map { |i| i.class }.include?(ActiveModel::Validations::PresenceValidator) && @item.send(attribute).exists? message = _t("Remove %{attribute}", :attribute => @item.class.human_attribute_name(attribute).downcase) label_text << <<-HTML #{link_to message, { :action => 'detach', :id => @item, :attachment => attribute }, :confirm => _t("Are you sure?")} HTML end %>