Sha256: 841a50541b74e1899611504956c6bba5585c36268a8bf5fd7c3d9d4540d4d268
Contents?: true
Size: 572 Bytes
Versions: 11
Compression:
Stored size: 572 Bytes
Contents
# frozen_string_literal: true module Mihari module Controllers class TagsController < BaseController get "/api/tags" do tags = Mihari::Tag.distinct.pluck(:name) json tags end delete "/api/tags/:name" do name = params["name"] begin Mihari::Tag.where(name: name).destroy_all status 204 body "" rescue ActiveRecord::RecordNotFound status 404 message = { message: "Name:#{name} is not found" } json message end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems