Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Render or Redirect?

Render or Redirect?

Learn the difference between render and redirect in Ruby on Rails

Ivan Storck

July 08, 2013
Tweet

More Decks by Ivan Storck

Other Decks in Programming

Transcript

  1. Render Or Redirect? 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?
  2. Render Or Redirect? 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.
  3. Render Or Redirect? Render Remember this picture of a painter

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