# \_\_END\_\_ equivalent for erb?

**URL:** <https://www.ruby-forum.com/t/end-equivalent-for-erb/102049>\
**Category:** Rails\
**Created:** [February 7, 2006, 4:24pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049 "2006-02-07T16:24:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 7, 2006, 4:24pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049/1 "2006-02-07T16:24:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 7, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049/2 "2006-02-07T16:27:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 7, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049/3 "2006-02-07T16:42:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 11, 2006, 9:11pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049/4 "2006-02-11T21:11:34Z")

</div>

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/](http://blog.inquirylabs.com/)

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 15, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/end-equivalent-for-erb/102049/5 "2006-02-15T22:53:12Z")

</div>

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
