chore: update buttons to PUT data when deleting/undeleting story
This commit is contained in:
parent
4778cd5673
commit
04982be4bb
|
@ -45,20 +45,15 @@
|
|||
|
||||
<% if @story.is_gone? && @story.is_undeletable_by_user?(@user) %>
|
||||
|
|
||||
<%= link_to "Undelete", story_undelete_path(@story.short_id),
|
||||
:method => :post, :data => {
|
||||
:confirm => "Are you sure you want to undelete this story?" },
|
||||
:class => "button" %>
|
||||
<%= f.submit "Undelete", formaction: story_undelete_path(@story.short_id),
|
||||
:data => { :confirm => "Are you sure you want to undelete this story?" } %>
|
||||
<% elsif !@story.is_gone? %>
|
||||
|
|
||||
<% if @story.user_id != @user.id && @user.is_moderator? %>
|
||||
<%= link_to "Delete", story_path(@story.short_id),
|
||||
:method => :delete, :class => "button mod_story_link deletion" %>
|
||||
<%= f.submit "Delete", formaction: story_destroy_path(@story.short_id), :class => "deletion" %>
|
||||
<% else %>
|
||||
<%= link_to "Delete", story_path(@story.short_id),
|
||||
:method => :delete, :data => {
|
||||
:confirm => "Are you sure you want to delete this story?" },
|
||||
:class => "button" %>
|
||||
<%= f.submit "Delete", formaction: story_destroy_path(@story.short_id),
|
||||
:class => "deletion", :data => { :confirm => "Are you sure you want to delete this story?" } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -78,7 +78,8 @@ Rails.application.routes.draw do
|
|||
post "upvote"
|
||||
post "flag"
|
||||
post "unvote"
|
||||
post "undelete"
|
||||
put "destroy"
|
||||
put "undelete"
|
||||
post "hide"
|
||||
post "unhide"
|
||||
post "save"
|
||||
|
|
Loading…
Reference in New Issue