Forum: Ruby on Rails Response.End / Exit equivalent in Rails??

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3151cc3624fa4f131c4a33ef4d67531d?d=identicon&s=25 Sy Ys (yeago)
on 2007-05-27 18:11
If the user types in junk, I'd like to return the user to the original

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

def getBody url
                open(url) do |file|
                        @body =
        rescue SystemCallError
                flash[:notice] = 'Check failed. This may be a bug but
its probably just your fault.'
                render :action => 'new'
                ###STOP THE BOAT HERE!!!!
15eb647956921a6bc9655c3513feb139?d=identicon&s=25 lanzm (Guest)
on 2007-05-28 12:42
(Received via mailing list)
it seems getBody() is a helper ? i'd catch the exeption in the
controller action, redirect or render the page you want. notice that
you can't call render more than once, but you can call return after
the render call:

  def index
    render :action=>:one and return if params[:id].to_i > 10
    render :action=>:two

This topic is locked and can not be replied to.