Hello, everyone I am a student studying Ruby Onrails. As you can see below on the controller, Clear the contents of the code in Restaurant Weight I'd like to copy all the contents of any table to Restaurant Weight.
3 def my_interest
4 require 'json'
5 render json: params
6 #render text: "jein"
7 #redirect_to '/'
8
9 del = RestaurantWeight.all
10 del.each do |a|
11 a.destroy
12 end
13
14 end
Delete_all / destroy_all will delete everything.
© 2024 OneMinuteCode. All rights reserved.