Class: Pageflow::Editor::OembedsController Private

Inherits:
ApplicationController show all
Defined in:
app/controllers/pageflow/editor/oembeds_controller.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#showObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/pageflow/editor/oembeds_controller.rb', line 9

def show
  provider = Pageflow.config.oembed_providers.find_by_name!(params[:provider])
  oembed_response = provider.get(params[:url])

  render json: oembed_response.fields
rescue Pageflow::OembedProviderNotFoundError
  head :unprocessable_entity
rescue OEmbed::NotFound
  head :not_found
end