#19 Wiki 新規作成完成

このコミットが含まれているのは:
2025-06-11 00:04:21 +09:00
コミット 56f9ba699c
7個のファイルの変更109行の追加180行の削除
+3 -3
ファイルの表示
@@ -13,17 +13,17 @@ class WikiPage < ApplicationRecord
page&.raw_data
end
def body= content, user:
def set_body content, user:
page = wiki.page("#{ id }.md")
commit_info = { message: "Update #{ title }",
name: user.id,
name: user.id.to_s,
email: 'dummy@example.com' }
if page
page.update(content, commit: commit_info)
else
wiki.write_page("#{ id }.md", :markdown, content, commit_info)
wiki.write_page(id.to_s, :markdown, content, commit_info)
end
end