1 of 13

Slide Notes

It can be an anxiety producing question.

In your Rails controller, which action should you call, render? or redirect? What is the difference?
DownloadGo Live

Render Or Redirect?

Published on Nov 19, 2015

No Description

PRESENTATION OUTLINE

RENDER OR REDIRECT?

It can be an anxiety producing question.

In your Rails controller, which action should you call, render? or redirect? What is the difference?
Photo by Randi Deuro

PIKE OR PINE?

ACTIONCONTROLLER::BASE

"READ THE SOURCE, LUKE" - OBI WTF
Photo by myrrh.ahn

REDIRECT

Think of redirect as a "gate change" for your flight. You've got to move locations. Redirect changes the URL that the user is on.

RENDER

Remember this picture of a painter for render.

Render "re-paints" the new content into the same location where you are.

Photo by martinak15

WHICH IS DEFAULT?

Photo by jev55

RENDER

RENDER IS OVERLOADED

Photo by terbeck

USUALLY IN VIEW

Photo by jasohill

RENDER IN CONTROLLER

REDIRECT

REDIRECT_TO

Photo by cronewynd

REDIRECT IS NOT RETURN

Photo by vgm8383