Complete Lesson 15
This commit is contained in:
parent
bc7bcca0c3
commit
8019ae0bfd
@ -24,6 +24,11 @@ class MoviesController < ApplicationController
|
||||
@movie.save
|
||||
redirect_to @movie
|
||||
end
|
||||
def destroy
|
||||
@movie = Movie.find(params[:id])
|
||||
@movie.destroy
|
||||
redirect_to movies_url, status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
</table>
|
||||
<section class="admin">
|
||||
<%= link_to "Edit", edit_movie_path(@movie), class: "button" %>
|
||||
<%= link_to "Delete", movie_path(@movie), class: "button", data: { turbo_method: :delete, turbo_confirm: "Are you sure?" } %>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
Loading…
x
Reference in New Issue
Block a user