Chapter 3, Tutorial 6, :text field + carriage returns

20 views
Skip to first unread message

Banjoey

unread,
Aug 16, 2011, 8:24:59 PM8/16/11
to Hobo Users
OK, sometimes I'm just dense, so bare with me. I'm hung up on
something that really shouldn't be an issue (meaning I should forget
about it and move on) but I'm consumed by this now and "have" to
figure out what's happening...

I'm using 1.3 RC2 and when I create the recipe model with the body of
type :text, I enter text for a new recipe. When I put in carriage
returns, on the resulting page, I have something like this:

Recipe <br /> With <br /> Carriage <br /> Returns

Where the <br /> is displayed literally, not as a valid html line
break.

Can anyone tell me if this is correct behavior, and if not, how can I
fix it? It isn't critical as I'm just learning this stuff anyway, but
I'd like to know what's happening with this as it was not expected
behavior.

Thanks,
Joey

Matt Jones

unread,
Aug 16, 2011, 8:41:04 PM8/16/11
to hobo...@googlegroups.com


The br's are correct behavior, but the fact that they are HTML-escaped is not. For reference, what version of Rails are you running? They just released (as in an hour ago) 3.0.10, so double-check that the problem still exists there.

--Matt Jones

Banjoey

unread,
Aug 16, 2011, 9:20:53 PM8/16/11
to Hobo Users
Hey Matt. Just upgraded to 3.0.10 as you suggested. Still get the same
behavior. Anything else I can try?

kevinpfromnm

unread,
Aug 18, 2011, 1:48:57 PM8/18/11
to hobo...@googlegroups.com
Confirm seeing this behavior.  rails 3.0.9 or 3.0.10 with edge hobo rails3 branch.

kevinpfromnm

unread,
Aug 18, 2011, 2:02:56 PM8/18/11
to hobo...@googlegroups.com
as a workaround, ugly but gets the job done:

<def tag="view" for="text">
    <repeat with="&this.split(/\r\n/)">
        <%= h this %><br />
    </repeat>
</def>

Matt Jones

unread,
Sep 25, 2011, 6:58:56 PM9/25/11
to hobo...@googlegroups.com
This should be fixed now:

https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/967

--Matt Jones

> --
> You received this message because you are subscribed to the Google Groups "Hobo Users" group.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
>

Reply all
Reply to author
Forward
0 new messages