<% url = object_url(this, :method => :delete, :subsite => subsite) if url && can_delete? in_place = !(this == @this && request.method.downcase == "get") if in_place.nil? update_attrs, attributes = attributes.partition_hash(HoboRapidHelper::AJAX_UPDATE_ATTRS) ajax_attrs, attributes = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS) if image attributes[:src] ||= image_path(image) attributes[:type] ||= 'image' else attributes[:type] ||= 'submit' end label ||= t("hobo.actions.remove", :default=>"Remove") ajax_attrs[:confirm] = confirm ? confirm : t("hobo.messages.confirm_delete", :name => this.to_s, :default=>"Are you sure that you want to delete #{this.to_s}?") add_classes!(attributes, image ? "image-button" : "button", "delete-button delete-#{this.class.name.underscore.dasherize}-button") if in_place && update_attrs.blank? data_rapid = data_rapid(:delete_button) ajax_attrs[:update] ||= "" # force form ajax elsif !update_attrs.blank? ajax_attrs.merge!(update_attrs) data_rapid = nil else data_rapid = nil end end %>