Files
discourse/app/controllers/inline_onebox_controller.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
403 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-07-19 15:08:54 -04:00
class InlineOneboxController < ApplicationController
requires_login
2017-07-19 15:08:54 -04:00
def show
2018-11-13 02:39:20 +05:30
hijack do
oneboxes = InlineOneboxer.new(
params[:urls] || [],
user_id: current_user.id,
category_id: params[:category_id].to_i,
topic_id: params[:topic_id].to_i
).process
2018-11-13 02:39:20 +05:30
render json: { "inline-oneboxes" => oneboxes }
end
2017-07-19 15:08:54 -04:00
end
end