Forum: Ruby on Rails image_tag size question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Harm A. (Guest)
on 2007-01-25 23:05
Hi all,
This used to work in Rails 1.1:
<%= image_tag('blue.jpg', :size => "#{count / total * max_length}x9") %>
However now in 1.2 it seems broken. This expression yield an unresize
1x1 blue pixel.
What am I doing wrong? All the variables used exist...

Harm
Harm A. (Guest)
on 2007-01-25 23:25
Harm Aa wrote:
> Hi all,
> This used to work in Rails 1.1:
> <%= image_tag('blue.jpg', :size => "#{count / total * max_length}x9") %>
> However now in 1.2 it seems broken. This expression yield an unresize
> 1x1 blue pixel.
> What am I doing wrong? All the variables used exist...
>
> Harm

As tradition dictates, it suddenly hit me. Count and total where
integers... And got rounded down to zero... Right, fixed it. Thanks you
all for your attention, I'm going to be embarrassed now.

Harm
This topic is locked and can not be replied to.