__END__ equivalent for erb?


#1

Time and time again I find the need to terminate evaluation of an erb
file on a certain line for debugging purposes, but can’t figure out a
way to do it. Is this possible?

Thanks!
John


#2

John W. wrote:

Time and time again I find the need to terminate evaluation of an erb
file on a certain line for debugging purposes, but can’t figure out a
way to do it. Is this possible?
You might have some luck with the breakpoint method.


#3

John W. <devlists-rubyonrails@…> writes:

Time and time again I find the need to terminate evaluation of an erb
file on a certain line for debugging purposes, but can’t figure out a
way to do it. Is this possible?

You need breakpointer. You’ll need to start the breakpointer utility in
another
terminal:
./script/breakpointer

Now you can put the function breakpoint() anywhere in your controllers
and I
think in erb as well. The server will halt execution at the breakpoint,
and the
terminal that’s running breakpointer will put you into a ruby console
where you
can inspect variables modify values, etc. Type CTRL-D to resume.

Mark


#4

On Feb 7, 2006, at 8:21 AM, John W. wrote:

Time and time again I find the need to terminate evaluation of an erb
file on a certain line for debugging purposes, but can’t figure out a
way to do it. Is this possible?

Thanks!
John

I highly recommend breakpoint as well; however, if you want to
“terminate” an erb file, you could wrap the second half in an “if
false” statement:

<% if false %>
html goes here
<% other erb statements %>
<% end %>

It’s kind of a block comment hack for erb.

Duane J.
(canadaduane)
http://blog.inquirylabs.com/


#5

On Saturday, February 11, 2006, at 1:08 PM, Duane J. wrote:

<% if false %>
html goes here
<% other erb statements %>
<% end %>

More inline with what I was looking for, but still won’t allow invalid
code in the block, which END let’s you do…a very useful feature.

Consider a page that does some dynamic actions in which you’re getting a
nil exception, but you’re not sure why. You’d like to lump a few
.inspect calls at the top of the file and then end processing there, but
it doesn’t seem this is possible. I feel this would be an extremely
useful feature…

Thanks for the suggestions regardless!

John