Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
6 Posts
a little bug

I agree with Paul, overflow:automatic or maybe overflow:hidden would be the easiest options. as this is happening with link, nobody needs to see the whole link anyway, and they would still have access to it. the page will break right after the link, so no words will be missed with overflow:hidden. remember jsut not to put an absolute value for height.

With all respect to Del, I feel pretty strongly about using CSS and valid XHTML only for layout and style. I don't feel that it would necessarily be a good idea to resort to Ruby code for this type of challenge. The problem is in the markup and/or CSS and should be addressed at that level IMHO.

You can also use this in your ruby code:

def split_str(str, len = 100)

fragment = /.{#{len}}/ 
str.split(/(\s+)/).map! { |word| 
  (/\s/ === word) ? word : word.gsub(fragment, '\0 <br /> ' ) 
}.join 

end

Well it might not be a great idea but you could set a max-width value and turn overflow:auto on with CSS. This would create a horizontal scroll bar on the fields that exceed the width and don't wrap. max-width only works with Firefox and is disregarded by IE6 and lower but IE seems to be working fine already.

I have the same problem. I'm on Firefox on WinXP. Resolution 1600 x 1200.

It works fine in IE6 and IE7, just not in Firefox.

Hi, i just found this little bug on the forum, take a look: http://www.workingwithrails.com/forums/1-general-discussion/topics/91-gedit-and-rails?page=1#posts-431 maybe it's just me, but the rest of the threads look alrite. im using FF in 1650:1080 on winxp

edited: the same thing happens here, there's no overflow block so longer words will just go straight through to the menu on the right. try css maybe?

6 Posts
Login to add your message