Skip to content

Instantly share code, notes, and snippets.

@kareemgrant
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save kareemgrant/b18056f83d1388719f5d to your computer and use it in GitHub Desktop.

Select an option

Save kareemgrant/b18056f83d1388719f5d to your computer and use it in GitHub Desktop.

Rails Authentication

Goals

  1. Implement authentication into a rails application

Assignment

This homework assignment requires that you build upon your existing blog app (from the prior homework assignment)

  1. Add a users model to your blog and add logic that allows users to login (and logout) of the application (use the has_secure_password method covered in class).

  2. In your layout file, display the logged-in user's email address (only if someone is logged in). Display a link that allows a user to log in if no user is currently logged in.

  3. Add logic that only allows non-logged-in users to view an index (list) of posts and authors.

Recommended Activity

Watch Railscasts: Rails Authentication from scratch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment