Class: Passportist::UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Passportist::UsersController
- Defined in:
- app/controllers/passportist/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 |
# File 'app/controllers/passportist/users_controller.rb', line 9 def create respond_with User.create(params[:user], as: :passportist), location: nil end |
#destroy ⇒ Object
31 32 33 |
# File 'app/controllers/passportist/users_controller.rb', line 31 def destroy respond_with User.destroy(@user) end |
#sync ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/passportist/users_controller.rb', line 13 def sync params[:user].each do |user_data| user = User.find_or_initialize_by_uid(user_data['uid']) user.name = user_data['name'] user.nickname = user_data['nickname'] user.email = user_data['email'] user.token = user_data['token'] user.save! end render nothing: true end |
#update ⇒ Object
27 28 29 |
# File 'app/controllers/passportist/users_controller.rb', line 27 def update respond_with @user.update_attributes(params[:user], as: :passportist) end |