Ruby On Rails Classroom image

Neha  Jaggi / Professional / 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).)

 

 
 
 
image
Neha  Jaggi

Skills    Ruby On Rails

Qualifications :- High School - , College/University - Graphic Era Hill University, Dehradun, College/University - ,
Location :-Dehradun,Dehradun,UTTARAKHAND,India
Description:-

Experienced Software Developer with a demonstrated history of working in the Information Technology and services industry. Skilled in Web Technologies (Ruby on Rails, PostgreSQL, php, Laravel and AJAX). 


Explore
 

  Students (0)