This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/controllers/clicks_controller.rb
T
2019-05-07 16:37:43 +10:00

19 lines
418 B
Ruby

class ClicksController < ApplicationController
skip_before_action :check_xhr, :preload_json, :verify_authenticity_token
def track
params.require([:url, :post_id, :topic_id])
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
end