# Response.End / Exit equivalent in Ruby?

**URL:** <https://www.ruby-forum.com/t/response-end-exit-equivalent-in-ruby/105224>\
**Category:** Ruby\
**Created:** [May 27, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/response-end-exit-equivalent-in-ruby/105224 "2007-05-27T16:41:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeago](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/eada6e/32.png) [@yeago](https://www.ruby-forum.com/u/yeago)\
**Post date:** [May 27, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/response-end-exit-equivalent-in-ruby/105224/1 "2007-05-27T16:41:23Z")

</div>

If the user types in junk, I’d like to return the user to the original  
page.

Can’t seem to do it. How is this typically handled?

def getBody url  
begin  
open(url) do |file|  
@body = file.read  
end  
rescue SystemCallError  
flash[:notice] = ‘Check failed. This may be a bug but  
its probably just your fault.’  
render :action =\> ‘new’  
###STOP THE BOAT HERE!!!  
end  
end

---

<div class="post-metadata">

**Author:** ![yeago](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/eada6e/32.png) [@yeago](https://www.ruby-forum.com/u/yeago)\
**Post date:** [May 27, 2007, 6:10pm UTC](https://www.ruby-forum.com/t/response-end-exit-equivalent-in-ruby/105224/2 "2007-05-27T18:10:32Z")

</div>

On 5/27/07, Sy Ys [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> If the user types in junk, I’d like to return the user to the original  
> page.
> 
> Can’t seem to do it. How is this typically handled?

This seems like a Rails question. You may want to ask on a Rails forum  
instead.

-austin
