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 | 5|Last
Lessons:- Edit Form

 

Getting the tests to pass requires making the actual edit view, shown in Listing 9.3. Note how closely this resembles the new user view from Listing 7.17; the large overlap suggests factoring the repeated code into a partial, which is left as an exercise (Section 9.6).

 

___________________________________________________________________________________________________

 

Here we have reused the shared error_messages partial introduced in Section 7.3.2. With the @user instance variable from Listing 9.2, the edit page tests from Listing 9.1 should pass:

bundle exec rspec spec/requests/user pages spec.rb -e "edit page"

 

The corresponding page appears in Figure 9.2, which shows how Rails automatically pre-fills the Name and Email fields using the attributes of the @user variable.

         Looking at the HTML source for Figure 9.2, we see a form tag as expected (Listing 9.4).  

 
 
 
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)