Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|
Lessons:- Signup Failure

Of course, instantiating such a variable has implications for successful signup—as we’ll see in Section 7.4, once @user is defined properly, calling @user.save is all that’s needed to complete the registration—but it has consequences even in the failed signup considered here. Note in Figure 7.15 that the fields are pre-filled with the data from the failed submission. This is because form_for automatically fills in the fields with the attributes of the @user object, so that, for example, if @user.name is "Foo" then

 

 

will produce the HTML

 

Here the value of the input tag is "Foo", so that’s what appears in the text field. As you might guess, now that we can submit a form without generating an error, the test for invalid submission should pass:

$ bundle  exec rspec spec/requests/user pages spec.rb \
-e "signup with invalid information"
 
 
 
image
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
Explore
 

  Students (0)