Use buttons to destroy drafts and questions

As mentioned in commits 5311daadf and bb958daf0, using links combined
with JavaScript to generate POST (or, in this case, DELETE) requests to
the server has a few issues.
This commit is contained in:
Javi Martín
2024-03-06 04:53:15 +01:00
parent 20d3725709
commit ecad046a99
8 changed files with 21 additions and 16 deletions

View File

@@ -24,9 +24,9 @@ module ActionDispatch::Routing::UrlFor
end
def namespaced_polymorphic_path(namespace, resource, options = {})
if %w[Budget::Group Budget::Heading Poll::Booth Poll::BoothAssignment Poll::Officer
Poll::Question Poll::Question::Answer Poll::Question::Answer::Video Poll::Shift
SDG::LocalTarget].include?(resource.class.name)
if %w[Budget::Group Budget::Heading Legislation::DraftVersion Legislation::Question
Poll::Booth Poll::BoothAssignment Poll::Officer Poll::Question Poll::Question::Answer
Poll::Question::Answer::Video Poll::Shift SDG::LocalTarget].include?(resource.class.name)
resolve = resolve_for(resource)
resolve_options = resolve.pop