This commit is contained in:
2026-03-26 23:52:44 +09:00
parent ef6219dcb1
commit fb275b4763
5 changed files with 14 additions and 16 deletions
@@ -33,6 +33,6 @@ class WikiAssetsController < ApplicationController
page.update!(next_asset_no: no + 1)
end
render json: asset
render json: asset.as_json(methods: [:url])
end
end
+4
View File
@@ -7,4 +7,8 @@ class WikiAsset < ApplicationRecord
has_one_attached :file
validates :file, presence: true
def url
Rails.application.routes.url_helpers.rails_blob_url(file, only_path: true)
end
end