akkounts/app/controllers/contributions/other_controller.rb
Râu Cao 6713665a61
Some checks failed
continuous-integration/drone/push Build is failing
WIP Rename "projects" page, make content editable
2025-05-28 18:42:10 +04:00

23 lines
594 B
Ruby

class Contributions::OtherController < ApplicationController
before_action :authenticate_user!
before_action :set_content_editing
# 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
private
def set_content_editing
return unless params[:edit] && current_user.is_admin?
@edit_content = true
end
end