module PostsHelper def image_dimensions(post, current_user) if post.is_image? "(#{post.image_width_for(current_user)}x#{post.image_height_for(current_user)})" else "" end end def image_dimension_menu(post, current_user) html = "" file_size = number_to_human_size(post.file_size) original_dimensions = post.is_image? ? "(#{post.image_width}x#{post.image_height})" : nil large_dimensions = post.has_large? ? "(#{post.large_image_width}x#{post.large_image_height})" : nil medium_dimensions = post.has_medium? ? "(#{post.medium_image_width}x#{post.medium_image_height})" : nil current_dimensions = "(#{post.image_width_for(current_user)}x#{post.image_height_for(current_user)})" html << %{} html << %{
  • #{file_size} #{current_dimensions}
  • } html << %{} html << %{
    } html.html_safe end end