Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

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

  Destroying Microposts

The last piece of functionality to add to the Microposts resource is the ability to destroy posts. As with user deletion (Section 9.4.2), we accomplish this with ‘‘delete’’ links, as mocked up in Figure 10.16. Unlike that case, which restricted user destruction to admin users, the delete links will work only for microposts created by the current user.

          Our first step is to add a delete link to the micropost partial as in Listing 10.43, and while we’re at it we’ll add a similar link to the feed item partial from Listing 10.43. The results appear in Listing 10.46 and Listing 10.47. (The two cases are almost identical, and eliminating this duplication is left as an exercise (Section 10.5).)


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

  Students (0)