Forum: Ruby on Rails help !

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.
Italo M. (Guest)
on 2007-02-01 16:08
(Received via mailing list)
who i show in .rhtml my text "<b> Hellow! </b>" bold ?

//Controller
...
@message = "<b> Hellow! </b>"

...
//view
...
<%= @message %>
...

result:
<b>Hellow! </b>


i would like
Hellow!





--
Ítalo Matos
Thorsten L (Guest)
on 2007-02-01 16:38
(Received via mailing list)
Next time choose a better subject then "help!". It's not describtive
about your problem. Most people won't read it.

//Controller
...
@message = "Hellow!"


...
//view
...
<%= "<br>#{@message}</b>" %>
Italo M. (Guest)
on 2007-02-01 17:28
(Received via mailing list)
it forgives ,

the message is dinamic.
the message comes of the data base with tags.







2007/2/1, Thorsten L <removed_email_address@domain.invalid>:
> ...
> > @message = "<b> Hellow! </b>"
> > i would like
> > Hellow!
> >
> > --
> > Ítalo Matos
>
>
> >
>


--
Ítalo Matos
Phlip (Guest)
on 2007-02-01 17:59
(Received via mailing list)
Italo M. wrote:

> the message is dinamic.
> the message comes of the data base with tags.

Try these two experiments in your rhtml:

<%= '<strong> yo </strong>' %>

<%=h '<strong> yo </strong>' %>

The first should be bold, and the second should show <strong> etc in
your browser.

The h escapes < to &lt;. Without it, you should get raw HTML.

Now check your database - does it reeeally have < > in it? or &lt; &gt;?

--
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!
Italo M. (Guest)
on 2007-02-01 20:23
(Received via mailing list)
Yes..

the problem is interpret html tag
<b></b>
<a href=""></a>
etc




2007/2/1, Phlip <removed_email_address@domain.invalid>:
>
>   Phlip
>   http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!
>
> >
>


--
Ítalo Matos
Phlip (Guest)
on 2007-02-01 20:26
(Received via mailing list)
Italo M. wrote:

> the problem is interpret html tag
> <b></b>
> <a href=""></a>
> etc

Please write complete posts with more details.

--
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!
This topic is locked and can not be replied to.