-
Notifications
You must be signed in to change notification settings - Fork 10
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
Error fixed when image is missing #3
Conversation
@@ -6,4 +6,10 @@ | |||
tag.should match('height="64"') | |||
tag.should match('width="50"') | |||
end | |||
|
|||
it "should not return no image or error if the image is missing" do |
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.
"should" in the example description is no longer a good practice I would reword it as
it "works with missing images"
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.
Whoops didn't know
New commit added ;) |
@@ -15,8 +15,9 @@ module Helper | |||
# | |||
def image_tag source, options = {} | |||
unless options[:size] | |||
fs_path = asset_paths.asset_for(source, nil).to_path | |||
options[:width], options[:height] = ::Dimensions.dimensions(fs_path) | |||
fs_path = asset_paths.asset_for(source, nil).blank? ? "" : asset_paths.asset_for(source, nil).to_path |
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.
Here asset_paths.asset_for
is called twice, but I'll fix it after the merge :)
thanks for the patience ;)
EDIT fixed in bd9bcee
Error fixed when image is missing
Fix for #2