You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 6, 2021. It is now read-only.
Nested resources need a URL through their parent resource(s), and it must honour the retrieving request's path (in case they belong_to multiple models), ex. /path/via/gallery1/photo/1/file, /path/via/gallery/10/photo/1/file, /path/via/person/5/photo/1/file.
Approaches
How can we obtain the request or URL from the controller when inside the model?
Use Thread.current to store the request. Handled easily by the request_store gem. Then use the Rails router to re-parse the request.url? Or, put only the requisite parts of the parsed request into the Thread local instead of the entire request?
Could we decorate the model using ActionView (like FormBuilder) on the way out of the controller?
Can @article.url call a Proc, which is executed with the binding of the view [controller?] to access the request?
defurlProc.newdo# Access the request ... ? We can capture the request using a Thread local.end.callend
The text was updated successfully, but these errors were encountered:
carrierwave-activerecord/lib/carrierwave-activerecord/storage/storage_provider.rb
Line 61 in 0b48c23
Nested resources need a URL through their parent resource(s), and it must honour the retrieving request's path (in case they
belong_to
multiple models), ex./path/via/gallery1/photo/1/file
,/path/via/gallery/10/photo/1/file
,/path/via/person/5/photo/1/file
.Approaches
Use
Thread.current
to store therequest
. Handled easily by therequest_store
gem. Then use the Rails router to re-parse therequest.url
? Or, put only the requisite parts of the parsed request into the Thread local instead of the entire request?ActionView
(likeFormBuilder
) on the way out of the controller?Can
@article.url
call a Proc, which is executed with the binding of the view [controller?] to access therequest
?The text was updated successfully, but these errors were encountered: