Finish MVP for content editing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user