Skip to content
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

Merged
merged 2 commits into from
Jun 19, 2012

Conversation

jeroeningen
Copy link
Contributor

Fix for #2

@@ -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
Copy link
Owner

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops didn't know

@jeroeningen
Copy link
Contributor Author

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
Copy link
Owner

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

elia added a commit that referenced this pull request Jun 19, 2012
@elia elia merged commit 8496644 into elia:master Jun 19, 2012
dfranciosi pushed a commit to dfranciosi/dimensions-rails that referenced this pull request May 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants