RE: Re: how to output something from within <% %> tags?


#1

Helpers are meant for this. That’s why they exist. You put your output
code in the helper function and call it in your view. That’s probably
why they disabled it… It forces you to keep your views cleaner.


#2

Hogan, Brian P. wrote:

Helpers are meant for this. That’s why they exist. You put your output
code in the helper function and call it in your view. That’s probably
why they disabled it… It forces you to keep your views cleaner.

er, so what helper code do I need? as I said, the one I tried gave me an
error. and being forced to use <%= is just making my views messier, cfr.
my example.


#3

Just stuff all that messy logic into a helper and call that

instead of

<% code
more code
output something %>

you could do

<%= fancy_helper %>

where fancy_helper is

def fancy_helper
code
more code
output something
end

_Kevin

if that doesn’t do the trick, try posting some real code from your view
and I’m sure we could find a way to clean it up.