Skip to content

Instantly share code, notes, and snippets.

@hungrysquirrel
Created August 9, 2012 18:42
Show Gist options
  • Save hungrysquirrel/3306970 to your computer and use it in GitHub Desktop.
Save hungrysquirrel/3306970 to your computer and use it in GitHub Desktop.
def saved_search_image_with_attributes
property_image = saved_search_property.album.best_first_image_for_size(560, 320)
width = property_image.respond_to?(:width) ? property_image.width : 320
width_for_display = width > 0 ? width : 320
''.tap { |out|
out << content_tag(:a, :href => "#{auto_login_url}", :style =>"display: block;text-decoration: none; height: auto; :width => '#{width_for_display}';") do
"#{display_updated_attributes_for(saved_search_property)}"
end
}.html_safe
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment