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
Unable to use image_path in serializer #193
Comments
|
Hmmm. I am not 100% sure at this moment, to be honest. |
|
I'm having this issue as well, are there any solutions to this? I tried using |
|
I'm having the same problem :( I've included the |
|
@mrcasals I got mine to work, try including these at the top of your serializer: include Sprockets::Helpers::RailsHelper
include Sprockets::Helpers::IsolatedHelper
include ActionView::Helpers::AssetTagHelper |
|
Thanks for the update! /cc @morganick |
|
@jonchay's tip worked for me :) |
|
@jonchay thx |
|
Giving this a close, then. |
|
I had the same issue with Rails 4.1.1 and active_model_serializers 0.8.1. I solved it using Hope this helps :) |
We are stuck trying to reference the
image_pathhelper inside a serializer. We've tried includingAssetTagHelperdirectly, but it chokes with an error:Digging into the
AssetTagHelper, it seems coupled to a controller.Is there any way to reference these assets safely? Generating my own URLs feels a bit barbaric. :)
The text was updated successfully, but these errors were encountered: