Skip to content

Instantly share code, notes, and snippets.

View rickpeyton's full-sized avatar

Rick Peyton rickpeyton

View GitHub Profile
@rickpeyton
rickpeyton / gist:b2c8115f5536d8fa1a41
Last active August 29, 2015 14:15
Course 2: Quiz: Lesson 3
1. What's the difference between rendering and redirecting? What's the impact with regards to instance variables, view templates?
__Redirecting sends you off to a new action and clears all of your old instance variables. Rendering loads a view template. and retains your instance variables.__
2. If I need to display a message on the view template, and I'm redirecting, what's the easiest way to accomplish this?
__Use the flash[:notice] helper and store a message in it.__
3. If I need to display a message on the view template, and I'm rendering, what's the easiest way to accomplish this?
__Store the message in an instance variable and display it__
4. Explain how we should save passwords to the database.