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
end
marcel
On 27 Mai, 18:11, Sy Ys
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
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?
>
> 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
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---