# How to put exit like in php in Rails View

**URL:** <https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614>\
**Category:** Rails\
**Created:** [October 10, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614 "2008-10-10T14:33:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ac91a4/32.png) [@cyrus](https://www.ruby-forum.com/u/cyrus)\
**Post date:** [October 10, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614/1 "2008-10-10T14:33:41Z")

</div>

Hello All

Is it possible in rails view to put exit like in php …so that we can  
debug view in rails … ?

like in php you can print array and put exit …for debugging view

---

<div class="post-metadata">

**Author:** ![cyrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ac91a4/32.png) [@cyrus](https://www.ruby-forum.com/u/cyrus)\
**Post date:** [October 10, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-put-exit-like-in-php-in-rails-view/150614/2 "2008-10-10T15:20:02Z")

</div>

On Oct 10, 8:33 am, cyrusdev08 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello All
> 
> Is it possible in rails view to put exit like in php …so that we can  
> debug view in rails … ?
> 
> like in php you can print array and put exit …for debugging view

You can stop execution by raising an exception. For example:  
raise 'Forced #raise after doing X"

However, you don’t need to do that to print debugging messages. Simply  
use #puts or #pp or whatever, and it’ll appear in the server console  
of your Rails app. You just might need to scroll up a little in the  
console.

Cheers,  
Nick
