ActiveRecord 'destroy' method returns a boolean value in Ruby on Rails?
-
30-10-2019 - |
Вопрос
I am using Ruby on Rails 3 and I would like to know what type of return will have the following code:
@user.destroy
I need that to handle cases on success and fault in someway like this:
if @user.destroy
puts "True"
else
puts "false"
end
Is it possible? If so, how?
Нет правильного решения
Не связан с StackOverflow