Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|Last
Lessons:-Stats and a Follow Form

The follow/unfollow partials themselves are shown in Listing 11.25 and Listing 11.26.

 

These two forms both use form_for to manipulate a Relationship model object; the main difference between the two is that Listing 11.25 builds a new relationship, whereas Listing 11.26 finds the existing relationship. Naturally, the former sends a POST request to the Relationships controller to create a relationship, while the latter sends a DELETE request to destroy a relationship. (We’ll write these actions in Section 11.2.4.) Finally, you’ll note that the follow/unfollow form doesn’t have any content other than the button, but it still needs to send the followed_id, which we accomplish with the hidden_field method, which produces HTML of the form

 

 
 
 
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)