Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Delete things

Alexey Gaziev edited this page · 1 revision
Clone this wiki locally

Delete things

Here lies unsorted delete part of my old readme. I promisse - I'll do better soon.


  1. Delete all rows from table with attribute equals something:

    # regular variant:
    TableName.delete_all(['attribute = ?', value])
    # with Spik:
    delete all table_name with attribute_name 'something'

    for example with your table posts (and model Post) and table has attribute title:

    # regular variant:
    Post.delete_all(['title = ?', 'asd'])
    # with Spik:
    delete all posts with title 'asd'

    After this all posts rows with title 'asd' will be deleted

  2. Delete row from table with specific id:

    # regular variant:
    # with Spik:
    delete [first] table_name_row with id (numeric)

    for example with your table posts (and model Post):

    # regular variant:
    # with Spik:
    delete post with id 5

    After this post row with id 5 will be deleted

Something went wrong with that request. Please try again.