Which of the following updates a single attribute and saves the record (in Ruby on Rails)?

29. Which of the following updates a single attribute and saves the record?

  1. update_columns(attributes)
  2. update!(attributes)
  3. update_column(name, value)
  4. update_attribute(name, value)

Answer: D) update_attribute(name, value)

Explanation:

update_attribute(name, value) updates a single attribute and saves the record.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.