mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-02-21 20:20:34 +09:00
17 lines
289 B
Ruby
17 lines
289 B
Ruby
class UnfurlLinksController < ApplicationController
|
|
def create
|
|
opengraph = Opengraph::Metadata.from_url(url_param)
|
|
|
|
if opengraph.valid?
|
|
render json: opengraph
|
|
else
|
|
head :no_content
|
|
end
|
|
end
|
|
|
|
private
|
|
def url_param
|
|
params.require(:url)
|
|
end
|
|
end
|