# How can I abort processing in the middle of a page & return?

**URL:** <https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933>\
**Category:** Rails\
**Created:** [November 22, 2006, 3:39pm UTC](https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933 "2006-11-22T15:39:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_dogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@steve\_dogers](https://www.ruby-forum.com/u/steve_dogers)\
**Post date:** [November 22, 2006, 3:39pm UTC](https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933/1 "2006-11-22T15:39:34Z")

</div>

Hi, basically for those who know ColdFusion I’m looking for a CFABORT  
tag but in ruby on rails 😃

In a nutshell it’s used for debugging, i know in ruby you can use \<%=  
debug(@order) %\> to dump the content of the object, or even use  
breakpointers… it’s just that I’d love to have a way to just dump the  
object, then immediately abort the processing of the request and return  
the truncated results to the user.

That would save me a lot of time.

Any idea how I could do that?

TIA!

---

<div class="post-metadata">

**Author:** ![steve\_dogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@steve\_dogers](https://www.ruby-forum.com/u/steve_dogers)\
**Post date:** [November 22, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933/2 "2006-11-22T16:02:47Z")

</div>

throw an exception?

or, how about a

return;

---

<div class="post-metadata">

**Author:** ![steve\_dogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@steve\_dogers](https://www.ruby-forum.com/u/steve_dogers)\
**Post date:** [November 22, 2006, 4:04pm UTC](https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933/3 "2006-11-22T16:04:47Z")

</div>

steve dogers wrote:

> it’s just that I’d love to have a way to just dump the  
> object, then immediately abort the processing of the request and return  
> the truncated results to the user.
> 
> That would save me a lot of time.
> 
> Any idea how I could do that?

raise @object.inspect

or

return false (if you just want to abort processing).

You cannot, however, return the truncated results, as they don’t yet  
exist until rendered. Rails doesn’t work with, err, buffered output, I  
believe it’s called.

–  
Jakob S. - [http://mentalized.net](http://mentalized.net)

---

<div class="post-metadata">

**Author:** ![steve\_dogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc29f/32.png) [@steve\_dogers](https://www.ruby-forum.com/u/steve_dogers)\
**Post date:** [November 22, 2006, 5:38pm UTC](https://www.ruby-forum.com/t/how-can-i-abort-processing-in-the-middle-of-a-page-return/76933/4 "2006-11-22T17:38:47Z")

</div>

script/console ?
