Sha256: e501e98ea9a26a6bee5bb9f9f7b9a1ccc33680b0e2188f6616e7b8f584c1de0a
Contents?: true
Size: 752 Bytes
Versions: 10
Compression:
Stored size: 752 Bytes
Contents
# -*- encoding : utf-8 -*- module LoyalCore class Ajax::LikeTracksController < ::LoyalCore::AjaxController before_filter :authenticate_user! def touch target_clazz = ::LoyalCore.config.clazz_alias[params[:target_type]] result = {} if target_clazz && (target_clazz = target_clazz.constantize) target = target_clazz.find_by_uuid(params[:target_id]) _code = target.touch_liked_by!(current_user) if target result = { :code => _code, :count => target.liked_count } end end render :json => { :response => { :status => 200, :code => :success }, :result => result } end end end
Version data entries
10 entries across 10 versions & 1 rubygems