Ruby On Rails Classroom image

Neeraj  Amoli / Professional / 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/

 

 
 
 
image
Neeraj  Amoli

Skills    Ruby On Rails

Qualifications :-
Location :-Dehradun,Dehradun,Uttrakhand,India
Description:-

I have 3 year experience as a Software Engineer. My Skilled are Android Development (Java), ROR Development .   


Explore
 

  Students (0)