Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

To post your Question Join Classroom
Lesson Topics's No:-  ||
Lessons:-Unsuccessful Edits

  Unsuccessful Edits

In thissectionwe’ll handle unsuccessfuledits and get theerror messagestest in Listing 9.1 to pass. The application code creates an update action that uses update_attributes (Section 6.1.5) to update the user based on the submitted params hash, as shown in Listing 9.8. With invalid information, the update attempt returns false, so the else branch re-renders the edit page. We’ve seen this pattern before; the structure closely parallels the first version of the create action (Listing 7.21).




The resulting error message (Figure 9.3) is the one needed to get the error message test to pass, as you should verify by running the test suite:

bundle  exec rspec  spec/


Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student

  Students (0)