Ruby On Rails Classroom image

Neeraj  Amoli / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4 | 5|Last
Lessons:- The destroy Action

 

Web browsers can’t send DELETE requests natively, so Rails fakes them with JavaScript. This means that the delete links won’t work if the user has JavaScript

 

            Figure 9.14 The user index /users with delete links.

 

disabled. If you must support non-JavaScript-enabled browsers you can fake a DELETE request using a form and a POST request, which works even without JavaScript; see the RailsCast on ‘‘Destroy Without JavaScript’’ for details.

             To get the delete links to work, we need to add a destroy action (Table 7.1), which finds the corresponding user and destroys it with the Active Record destroy method, finally redirecting to the user index, as seen in Listing 9.46. Note that we also add :destroy to the signed_in_user before filter.

 

 
 
 
image
Neeraj  Amoli

Skills    Ruby On Rails

Qualifications :-
Location :-Dehradun,Dehradun,Uttrakhand,India
Description:-

I have 3 year experience as a Software Engineer. My Skilled are Android Development (Java), ROR Development .   


Explore
 

  Students (0)