Forum: Ruby on Rails How to put exit like in php in Rails View

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9a55844258b2343f15dbafbcdcc14125?d=identicon&s=25 Cyrus Dev (cyrus)
on 2008-10-10 14:33
(Received via mailing list)
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
49de4cd2f26705785cbef2b15a9df7aa?d=identicon&s=25 Nick (Guest)
on 2008-10-10 15:20
(Received via mailing list)
On Oct 10, 8:33 am, cyrusdev08 <cyrusde...@gmail.com> 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
This topic is locked and can not be replied to.