Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Avatar
- include ActiveModel::Model
- # include ActiveModel::Serializers::JSON
- include ActiveModel::AttributeMethods
- include ActiveModel::Dirty
- # include ActiveModel::Validations
- def get_avatar(avatar_url,access_token)
- @avatar_clean = ApiConecction.get("#{avatar_url}",access_token)
- // aqui deberia tomar @avatar_clean.response_body y convertirlo en la imagen, pero no se que hacer
- end
- def update_avatar(file,access_token)
- p file.size
- response = ApiConecction.post("/Archivos/uploadAvatar",{:file => File.new(file.path , "rb"), :multipart => true} ,access_token)
- return cont = JSON.parse(response.response_body)['url']
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement