docbrown/app/views/api/v1/shared/_user_show.json.jbuilder
Fernando Valverde 8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00

17 lines
325 B
Ruby

json.type_of "user"
json.extract!(
user,
:id,
:username,
:name,
:twitter_username,
:github_username,
)
Profile.static_fields.each do |attr|
json.set! attr, user.profile.public_send(attr)
end
json.joined_at I18n.l(user.created_at, format: :json)
json.profile_image user.profile_image_url_for(length: 320)