mazoz
September 23, 2010, 5:44am
1
I have this in my .erb file
<%= text_area_tag ‘text’, h(@text ), :style => “width: 100%”, :rows => 6
%>
or
<%= text_area_tag ‘text’, html_escape(@text ), :style => “width: 100%”,
:rows => 6 %>
and it does not actually escape the characters
This is what is in my page source
<a
href="http://www.blahblah.org/blah">LetterAttack</a>
this is what i say
Any ideas would be appreciated
Thanks
mazoz
September 23, 2010, 9:35am
2
On 23 September 2010 04:44, Maz Z. [email protected] wrote:
This is what is in my page source
<a
href="http://www.blahblah.org/blah">LetterAttack</a>
this is what i say
What is in @text and what did you expect the html to look like?
Colin
mazoz
September 23, 2010, 10:20am
3
Colin L. wrote:
On 23 September 2010 04:44, Maz Z. [email protected] wrote:
This is what is in my page source
�<a
href="http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt ;
this is what i say
What is in @text and what did you expect the html to look like?
Colin
Hi
My question was not clear, I am seeing text in the textarea instead of
html
@text is
<ahref="http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt;this
is what i say
and what I want to see is
LetterAttack this is what i say
Thanks
mazoz
September 23, 2010, 4:07pm
5
html_scape does that , you are causing the output
mazoz
September 23, 2010, 4:04pm
6
Don’t do anything and the escaped characters will appear as you
intend.
in view code:
<% text = " <a href= "http://www.blahblah.org/
blah">LetterAttack…</a >
is what i say" -%>
<%= text -%>
renders like this:
LetterAttack…
is what i say
mazoz
September 24, 2010, 6:58am
7
Phillip wrote:
Don’t do anything and the escaped characters will appear as you
intend.
in view code:
<% text = " <a href= "http://www.blahblah.org/
blah">LetterAttack…</a >
is what i say" -%>
<%= text -%>
renders like this:
� <a href=� “http://www.blahblah.org/blah ”>LetterAttack…
is what i say
In the textarea on the html page it is rendering like
<ahref="http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt;this
is what i say
it is not
LetterAttack this is what i say
in the textarea
@text; h(@text); html_escape(@text) in the .erb file all display
<ahref=" http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt;this
is what i say
in the textarea on the html page
(where @text is
<ahref="http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt;this
is what i say)
I want it to display LetterAttack… is what i say
Thanks
mazoz
September 24, 2010, 8:55am
8
On 24 September 2010 05:58, Maz Z. [email protected] wrote:
LetterAttack this is what i say
I want it to display  LetterAttack… is what i say
I am still confused I am afraid. Do you want it to display <a href
=… so that is exactly what appears on the screen, or do you want it
to display a link to the URL, showing the text LetterAttack?
Colin
mazoz
September 27, 2010, 5:36am
9
Colin L. wrote:
On 24 September 2010 05:58, Maz Z. [email protected] wrote:
LetterAttack this is what i say
I want it to display  LetterAttack… is what i say
I am still confused I am afraid. Do you want it to display <a href
=… so that is exactly what appears on the screen, or do you want it
to display a link to the URL, showing the text LetterAttack?
Colin
Hi
I want to display html in the textarea i.e more like de-scaping as you
describe
<%= label_tag ‘text’, @text %>
<%= text_area_tag ‘text’, @text , :style => “width: 100%”, :rows => 6 %>
The label displays correctly i.e.
LetterAttack… is what i say
whereas in the textarea it is displayed as
<ahref="http://www.blahblah.org/blah&quot;&gt;LetterAttack&lt;/a&gt;this
is what i say
Thanks
mazoz
September 23, 2010, 5:23pm
10
On 23 September 2010 15:03, Phillip [email protected] wrote:
renders like this:
LetterAttack…
is what i say
Will it not display <a href… on screen rather than generating an
html href tag?
Colin