11155
(-- --)
1
I have a shell command statement in my controller that runs a ruby
script and puts this text output into my instance variable which I call
in my view.
Controller Code:
<code>
@data = `/usr/bin/ruby_script.rb`
</code>
View Code:
<code>
<%= @data %>
</code>
The problem is when @data has long strings of data, the don't wrap in my
view so they go off page in the browser.
How can I force long strings contained in @data to word wrap in the
browser?
I tried putting them in a table but that didn't help.
Thanks
jackster
hassan
(Hassan Schroeder)
2
I have a shell command statement in my controller that runs a ruby
script and puts this text output into my instance variable which I call
in my view.
View Code:
<code>
<%= @data %>
</code>
So are you really using the CODE tag? Regardless,
The problem is when @data has long strings of data, the don't wrap in my
view so they go off page in the browser.
http://www.w3.org/TR/CSS21/text.html#propdef-white-space
11155
(-- --)
3
"So are you really using the CODE tag? Regardless,"
Thanks Hassan,
No I'm not using these tags, I used them for the purposes of the forum
(which didn't help)....sorry about that confusion.
The link to that document looks like exactly what I need....it appears
that I need to do this in my CSS file?
thanks
jackster
hassan
(Hassan Schroeder)
4
No I'm not using these tags, I used them for the purposes of the forum
(which didn't help)....sorry about that confusion.
NP. The typical browser default for CODE tags is preformatted
(white space is significant and retained exactly). Anyway,
The link to that document looks like exactly what I need....it appears
that I need to do this in my CSS file?
Yes, apply the appropriate white-space setting to the selector for the
container (div, p, whatever) holding that content.
11155
(-- --)
5
Yes, apply the appropriate white-space setting to the selector for the
container (div, p, whatever) holding that content.
What about the fact that it's in a table, should I put the div tags
outside that?
thanks for the help
jackster
hassan
(Hassan Schroeder)
6
No, try applying the style directly to the container it's in, so if that's a
TD of a table, use that.