Sha256: 328de4fc05e46f11a089970a6f02cb124c872b093f1426cd4f4f362cb81e2b5f
Contents?: true
Size: 667 Bytes
Versions: 5
Compression:
Stored size: 667 Bytes
Contents
module Satis class UserDataController < ApplicationController def show key = request.url.split('/user_data/').last data = Satis.config.current_user.user_data.keyed(key) if data.id.present? render json: data.data, status: 200 else render json: {}, status: 404 end end def update key = request.url.split('/user_data/').last data = Satis.config.current_user.user_data.keyed(key) data.data = user_data_update_params.as_json data.save! render json: data.data, status: 200 end private def user_data_update_params params.require(:user_datum) end end end
Version data entries
5 entries across 5 versions & 1 rubygems