Forum: Ruby on Rails render (:action => 'xyz') in a private controller method

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.
Wes G. (Guest)
on 2006-04-18 00:04

I have a controller method (A) which gets called and then delegates some
validation to a private validation method (B).  This method in turn
attempts to call

render(:action => 'xyz')

in order to pass control back to the view upon an exception condition.

However, it simply completes the method B and returns control to A.

So, I take it that render only works inside of a controller method that
is directly invoked based on a HTTP request?

I guess I can throw exceptions in my private method (B) up to my public
controller method (A) and then handle them there?

Is that the preferred way to handle this?

This topic is locked and can not be replied to.