Home »
MCQs »
Ruby on Rails MCQs
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?
- update_columns(attributes)
- update!(attributes)
- update_column(name, value)
- update_attribute(name, value)
Answer: D) update_attribute(name, value)
Explanation:
update_attribute(name, value) updates a single attribute and saves the record.