Skip to content
Extraits de code Groupes Projets
apis_controller.rb 349 octets
Newer Older
  • Learn to ignore specific revisions
  • class ApisController < ApplicationController
      authenticate_with_oauth
      before_filter :set_user_from_oauth
    
      respond_to :json
    
      def me
        @person = @user.person
        render :json => {:birthday => @person.profile.birthday, :name => @person.name}
    
      private
      def set_user_from_oauth
        @user = request.env['oauth2'].resource_owner
    
    maxwell's avatar
    maxwell a validé
      end
    end