<% 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") confirm = t("hobo.messages.confirm", :default=>"Are you sure?") if confirm.nil? ajax_attrs[:confirm] = confirm if confirm 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 %>