The redirect does do something. Any further attempts at rendering or
redirecting should fail.
To be safe just add a return statement after the redirect to complete
the processing.
On 3 Dec 2005, at 21:17, Rick wrote:
> In one of my controller methods I need to set a flash[:notice] and
> redirect back to the form to show the error.
>
> I have this code:
>
> master_storeids = params[:master_storeid]
> if (master_storeids.nil?)
>
> flash[:notice] = ''No store was is selected''
> redirect_to :action => ''new_data''
> end
>
> followed by the "normal" code that would be proceesed if no error
> occurs.
>
> Problem is that the redirect doesn''t seem to do anything it just
> continues on to the remaining code.
>
> I have verified that master_storeids is nil and there is a new_data
> method in the controller.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails