Displaying 2 results from an estimated 2 matches for "success_act".
2006 Sep 22
6
Using after_filter to control rendering on actions
...in an after_filter method.
I''d like to use the after_filter to take over the control of the
rendering, like so:
def test_for_validity
some_boolean = my_test
return render(:action => ''disqualified'') unless some_boolean
@success_controller ||= controller_name
@success_action ||= action_name
return render(:controller => @success_controller, :action =>
@success_action)
end
In my action, if I do nothing unusual, then I expect to render to the
regular place. If I override @success_controller and/or
@success_action, then my action code can set up the success...
2006 Jul 19
5
Model Validation - with a twist
I''m stuck in a catch-22 type problem. I have an insert form for a table
that uses the validation in the model. i.e. When you click submit on the
form and haven''t filled in the required fields then you get the nice
rails error messages saying "field can not be blank". This works fine
until I introduce some more logic.
What I''m trying to do is to validate