Ruby On Rails Classroom image

prateek  darmwal / 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
prateek  darmwal

Skills    Ruby On Rails

Qualifications :- High School - S.K.M. Sn. Sec. School, Haldwani, College/University - Graphic Era Hill University, Bhimtal,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:- I like to explore new technologies. I have skills in ruby on rails, php5, cakephp, jquery, javascript, html/css, java, c & c++. I love coding
Explore
 

  Students (0)