'I would like to delete topic ids and subtopic ids once they are deleted from front end Via Rails API and can delete them from from my DB
How do delete ids sent in two arrays from DB:
this is how is what i want to delete in an array. Have tried and it deletes a few and others keep there. Please help me.
{"removed_subtopics": [123,312,312,321], "removed_topics" : [12,312,312] } ids = params[:removed] @deleted_ids = ids.split(",").select{|o| o['id'].to_i} @course.topics.where(id: @deleted_ids).delete_all
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
