23 lines
594 B
Ruby
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
|