#7 ぼちぼち

This commit is contained in:
2025-05-18 05:57:48 +09:00
parent 3b172e44d8
commit 2d6986d421
38 changed files with 2408 additions and 15068 deletions
@@ -1,8 +1,13 @@
class TagsController < ApplicationController
before_action :set_tags, only: %i[ show update destroy ]
def index
@tags = Tag.all
render json: @tags
end
def show
render json: @tag
end
def create
@@ -13,4 +18,15 @@ class TagsController < ApplicationController
def destroy
end
private
# Use callbacks to share common setup or constraints between actions.
def set_tag
@tag = Tag.find(params.expect(:id))
end
# Only allow a list of trusted parameters through.
def tag_params
params.expect(tag: [ :title, :body ])
end
end