discourse/app/controllers/clicks_controller.rb

Failed to ignore revisions in .git-blame-ignore-revs.

21 lines
449 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2013-02-05 14:16:51 -05:00
class ClicksController < ApplicationController
skip_before_action :check_xhr, :preload_json, :verify_authenticity_token
2013-02-07 10:45:24 -05:00
2013-02-05 14:16:51 -05:00
def track
params.require([:url, :post_id, :topic_id])
2013-02-05 14:16:51 -05:00
TopicLinkClick.create_from(
url: params[:url],
post_id: params[:post_id],
topic_id: params[:topic_id],
ip: request.remote_ip,
user_id: current_user&.id
)
render json: success_json
2018-06-07 01:28:18 -04:00
end
2013-02-07 10:45:24 -05:00
end