2009/12/4 jakemiles <jacob.miles / gmail.com>:
> Hi. =A0I'd like to use heredoc notation in an erb view (I'm using Merb,
> but I believe this is an erb issue, not specific to merb). =A0For
> example, I wrote a helper function that lets me use syntax like that
> below. =A0However, this example produces a parser error:
>
> can't find string "CODE" anywhere before EOF
>
> Any ideas how I can get this to work? =A0I posted this on the merb group
> as well, but I suspect it's really an erb issue:
>
> =A0<%=3D code "java", <<-CODE
>
> =A0 =A0 =A0 =A0// create a panel using a GridBagLayout
> =A0 =A0 =A0 =A0JPanel panel =3D new JPanel (new GridBagLayout());
>
> =A0 =A0 =A0 =A0// three labels on the first row
> =A0 =A0 =A0 =A0panel.add (new JLabel ("One"));
> =A0 =A0 =A0 =A0panel.add (new JLabel ("Two"));
> =A0 =A0 =A0 =A0panel.add (new JLabel ("Threeeee"));
>
> =A0CODE %>

Make that
CODE
%>

IOW, place the %> on the next line.

> If I can get this to work it would be a really cool technique for
> writing HTML helper functions.

HTML helper functions in Java in an ERB template?  How does this work?

Cheers

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/