Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. class Avatar
  2.  
  3. include ActiveModel::Model
  4. # include ActiveModel::Serializers::JSON
  5. include ActiveModel::AttributeMethods
  6. include ActiveModel::Dirty
  7. # include ActiveModel::Validations
  8.  
  9. def get_avatar(avatar_url,access_token)
  10.  
  11. @avatar_clean = ApiConecction.get("#{avatar_url}",access_token)
  12.  
  13. // aqui deberia tomar @avatar_clean.response_body y convertirlo en la imagen, pero no se que hacer
  14.  
  15. end
  16.  
  17.  
  18. def update_avatar(file,access_token)
  19. p file.size
  20. response = ApiConecction.post("/Archivos/uploadAvatar",{:file => File.new(file.path , "rb"), :multipart => true} ,access_token)
  21. return cont = JSON.parse(response.response_body)['url']
  22.  
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement