-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Latest 3.1.1.rc1 uses /images/ instead of /assets/ for image_tag helper #3126
Comments
You should use asset_tag if you want to access /assets/* files. |
So it's <%= asset_tag 'fortythree-logo-small.png', 'images' %> from now on, then? Feels a bit less DRY if you ask me, but perhaps that's the trade-off for backwards compatibility. |
Actually there's definitely a bug in 3.1.1 related to this, let me review it a bit more and I will get back to you again |
Absolutely. PS. Same bug if I'm using the image-url('file.png') in a scss or sass file, probably related. Renders url(/images/file.png) as well. |
Hi, maybe I am only making noise here, but as far as I can remember, image_tag hasn't changed it's behavior after the asset pipeline release. I've tried 3.1.0.rc4, 3.1.1.rc1 and branch 3-1-stable (right now). All returned /images/ from image_tag helper. Sorry if I am missing something. |
In 3.1.0 (final) image_tag used /assets/image.png if I turned on the asset pipeline, as I would expect. My images just continued loading fine. In the latest 3.1.1rc1 (pulled 5 mins ago), the image_tag still now returns /images/image.png, which is the old behavior. There has either been a policy change here or a bug. (If it's a policy change I don't quite like it; using image_tag to get /assets is the most logical way it should work, if we asked specifically to have the asset pipeline turned on.) |
Fantastic, works fine now. Still sass-rails gives /images/image.png when using the image-url helper, I've commented more lengthily over there. Thanks Santiago! |
I don't know if it's related but sass-rails helpers have the same issue (rails/sass-rails#57), |
I'm using latest stable rails 3.1.3 and image-url("icons/spinner.gif") generated /images/icons/spinner.gif instead of /assets/icons/spinner.gif -- what gives? EDIT: I was missing require "sprockets/railtie" in my application.rb - adding it fixed the problem! |
Verified by going back to 3.1.0, not changing any other gems or any code.
Using this in my Gemfile, last pulled today 5.minutes.ago:
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch=>'3-1-stable'
Using this image_tag:
<%= image_tag 'fortythree-logo-small.png' %>
The text was updated successfully, but these errors were encountered: