Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Active Storage for users profile picture #127

Merged
merged 9 commits into from Jan 10, 2019
Merged

Conversation

viktorsmari
Copy link
Member

@viktorsmari viktorsmari commented Jan 7, 2019

  • We also have the older user.avatar, for now

https://edgeguides.rubyonrails.org/active_storage_overview.html#linking-to-files

Issue

rails/rails#31228

  • We have a routing issue, our catchall: match "*path", to: "errors#not_found", via: :all is blocking access to /rails/active_storage

If we remove the match.. then we won't get the following custom error anymore:

{
id: "not_found",
message: "Endpoint not found",
errors: null,
url: null
}

Instead we get rails default "No route matches" error.
Is that ok?

Added a new endpoint /me/profile
Also on /me the user object has a profile_picture which has a timeout?
We still have the older user.avatar
Add full URL to .profile_picture

Open up for CORS in development
Disabling match all in routes, until a better solution is found.
See: rails/rails#31228
@viktorsmari viktorsmari changed the title Use active storage for users profile picture Use Active Storage for users profile picture Jan 10, 2019
@viktorsmari viktorsmari merged commit 4c1a4eb into master Jan 10, 2019
@viktorsmari viktorsmari deleted the use-active-storage branch January 29, 2019 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant