2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-19 15:08:54 -04:00
|
|
|
class InlineOneboxController < ApplicationController
|
2018-01-31 23:17:59 -05:00
|
|
|
requires_login
|
2017-07-19 15:08:54 -04:00
|
|
|
|
|
|
|
def show
|
2018-11-12 16:09:20 -05:00
|
|
|
hijack do
|
2020-02-12 05:11:28 -05:00
|
|
|
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-12 16:09:20 -05:00
|
|
|
render json: { "inline-oneboxes" => oneboxes }
|
|
|
|
end
|
2017-07-19 15:08:54 -04:00
|
|
|
end
|
|
|
|
end
|