app/controllers/admin/cms_controller.rb
def destroy

    # check whether this is right
    not_found and return unless action_allowed?( :destroy )

    # load the content + dump the context
    extract_content
    generate_titles

    # if we are either not HTML, or it’s been confirmed
    if !request.format.html? or params.key?( :confirm )

      # if it worked
      if @content.destroy

        respond_after_action( :destroy, :destroyed )

      else

        flash.now[:error] = status_t( @content, :destroy_failed )

      end

    end

  rescue ActiveRecord::RecordNotFound

    not_found and return

  end
# Destroys the given item of content, usually with confirmation.
#
# === Expected Parameters
#
# [id]  the ID of the content to delete
# [confirm] any value to confirm deletion of the item (just needs to be present)
Destroys the given item of content, usually with confirmation.
Expected Parameters

[id]  the ID of the content to delete
[confirm] any value to confirm deletion of the item (just needs to be present)
Destroys the given item of content usually with confirmation . Expected Parameters [ id ] the ID of the content to delete [ confirm ] any value to confirm deletion of the item ( just needs to be present )
def destroy
    not_found and return unless action_allowed?( :destroy )
    extract_content
    generate_titles
    if !request.format.html? or params.key?( :confirm )
      if @content.destroy
        respond_after_action( :destroy, :destroyed )
      else
        flash.now[:error] = status_t( @content, :destroy_failed )
      end
    end
  rescue ActiveRecord::RecordNotFound
    not_found and return
  end
def destroy not_found and return unless action_allowed? ( :destroy ) extract_content generate_titles if ! request . format . html? or params . key? ( :confirm ) if @content . destroy respond_after_action ( :destroy , :destroyed ) else flash . now [ :error ] = status_t ( @content , :destroy_failed ) end end rescue ActiveRecord :: RecordNotFound not_found and return end
Destroys the given item of content, usually with confirmation.
Destroys the given item of content usually with confirmation .
# check whether this is right # load the content + dump the context # if we are either not HTML, or it’s been confirmed # if it worked