Finish MVP for content editing

This commit is contained in:
2025-05-29 14:18:14 +04:00
parent 6713665a61
commit 6014134396
13 changed files with 92 additions and 59 deletions

View File

@@ -16,8 +16,14 @@ class Admin::EditableContentsController < Admin::BaseController
end
def update
return_to = params[:editable_content][:redirect_to].presence
if @editable_content.update(content_params)
render json: { status: "success", message: "Content updated" }, status: :ok
if return_to
redirect_to return_to
else
render status: :ok
end
else
render :edit, status: :unprocessable_entity
end

View File

@@ -4,12 +4,6 @@ class Contributions::OtherController < ApplicationController
# GET /contributions/other
def index
@content_title = EditableContent.find_or_create_by(
path: "contributions/other", key: "title"
)
@content_body = EditableContent.find_or_create_by(
path: "contributions/other", key: "body", rich_text: true
)
@current_section = :contributions
end