discourse/app/controllers/clicks_controller.rb

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

20 lines
446 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2013-02-06 03:16:51 +08:00
class ClicksController < ApplicationController
skip_before_action :check_xhr, :preload_json, :verify_authenticity_token
2013-02-07 23:45:24 +08:00
2013-02-06 03:16:51 +08:00
def track
params.require(%i[url post_id topic_id])
2013-02-06 03:16:51 +08: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
end
2013-02-07 23:45:24 +08:00
end