Class: Api::UserDataController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/api/user_data_controller.rb

Overview

Controller to retrieve data for the current user

Instance Method Summary collapse

Instance Method Details

#showObject

Return data about the user


15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/api/user_data_controller.rb', line 15

def show
  # If data has not changed, return a 304
  if stale? etag: EtagCalculator.etag(current_user.user_data_updated_at),
            last_modified: current_user.user_data_updated_at
    @user = current_user
    respond_with @user
  end
rescue => e
  handle_error e
end