Skip to content

Instantly share code, notes, and snippets.

@Alacrity01
Last active June 27, 2019 15:26
Show Gist options
  • Save Alacrity01/120885fbb02e7147efe9e1e3e0d44ccc to your computer and use it in GitHub Desktop.
Save Alacrity01/120885fbb02e7147efe9e1e3e0d44ccc to your computer and use it in GitHub Desktop.
Week 10, Day 4
rails active_storage:install
rake db:migrate
||in the model||
has_one_attached :avatar <- can call it anything (e.g. image)
json.array! @profiles.each do |profile|
json.name profile.name
json.avatar rails_blob_url(profile.avatar) if profile.avatar.attachment
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment