mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
22 lines
534 B
Ruby
22 lines
534 B
Ruby
class Admin::EmbeddingController < Admin::AdminController
|
|
|
|
before_filter :ensure_logged_in, :ensure_staff, :fetch_embedding
|
|
|
|
def show
|
|
render_serialized(@embedding, EmbeddingSerializer, root: 'embedding', rest_serializer: true)
|
|
end
|
|
|
|
def update
|
|
render_serialized(@embedding, EmbeddingSerializer, root: 'embedding', rest_serializer: true)
|
|
end
|
|
|
|
protected
|
|
|
|
def fetch_embedding
|
|
@embedding = OpenStruct.new({
|
|
id: 'default',
|
|
embeddable_hosts: EmbeddableHost.all.order(:host)
|
|
})
|
|
end
|
|
end
|