Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  |1 | 2 | 3 | 4 | 5|Last
Lessons:- Edit Form

Edit Form

We start with the edit form, whose mockup appears in Figure 9.1.1 As usual, we’ll begin with some tests. First, note the link to change the Gravatar image; if you poke around the Gravatar site, you’ll see that the page to add or edit images is located at http://gravatar.com/emails, so we test the edit page for a link with that URI.2

The tests for the edit user form are analogous to the test for the new user form in Listing 7.31 from the Chapter 7 exercises, which added a test for the error message on invalid submission. The result appears in Listing 9.1.

 

 

To write the application code, we need to fill in the edit action in the Users controller. Notefrom Table 7.1 that the proper URI for a user’sedit pageis /users/1/edit (assuming the user’s id is 1). Recall that theid of the user is availablein the params[:id] variable, which means that we can find the user with the code in Listing 9.2.

 
 
 
image
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)