when to use raise ? why just redirect_to.

I don't know what exactly raise work for. it seem redirect_to has the same functionality. well, I know I must be missed something. so anyone show some examples?

I don't know what exactly raise work for. it seem redirect_to has the same functionality. well, I know I must be missed something. so anyone show some examples?

redirect_to makes rails generate an http redirect response (which tells the browser to fetch another url instead) raise raises an exception. The two are completely unrelated. If you meant render rather than redirect_to, then the difference is that render just renders a template - there is no redirection.

Fred