-
Notifications
You must be signed in to change notification settings - Fork 39
Add image-path and image-url aliases #58
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
base: master
Are you sure you want to change the base?
Conversation
|
I don't know if they should just be aliases - the code used by |
|
Yeah I'll have to browse the sprockets codebase a little more and figure out what those passed options are actually doing hah - it's weird that they call asset_path right above, which is a shell method. I guess the answer is somewhere in a different file |
|
Ok I think I found what we're after - I'll see if I can adjust this to be more accurate.
|
|
Ok, most recent commit I think should do the trick. If this works out, it would be trivial to add the other helpers, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This options Hash won't do much effect since this method memoizes the first call into a instance variable, I guess we need to rework that a bit. One option would be to memoize the calls based on the given options on a Hash, like @assets_hashes[options] ||=.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm not entirely sure I understand what that first line is doing. If you could be a little more specific with the fix I might be able to better understand and add this in, or maybe you can make a commit that resolves this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the memoization (@assets_hash ||=) is used so the whole logic is executed once and cached in that instance variable. This works fine if the subsequent method calls are using the same arguments (or none), but that isn't the case anymore.
a_hash = assets_hash(scope)
# on this second call the same result of the previous call will be returned, regardless
# of the different options.
a_hash = assets_hash(scope, type: 'image')For the options Hash to have any effect this memoization needs to go away or the results should be cached differently.
|
Hello, is not generating the right url. It is looking for: instead of Anything we can do to help test? |
|
@planetmcd a sample app would be awesome. Are you using the branch from @Jenius fork? |
|
image-path and image-url still not working |
|
this is still an issue |
|
having this would be a plus! |
To be honest I have not tested this yet, but according to stylus it should work. Also wow the way this is added is so janky, there has to be a cleaner way to implement this...