Git Product home page Git Product logo

sessions_controller_lab-sfo01-seng-ft-042020's Introduction

Sessions Controller Lab

Objectives

We're going to build a Rails app that handles sessions with a SessionsController. We won't have passwords—for now, we're going to ask the user what to call them, and we'll just use that as their username.

Introduction

Our app will have two pages:

  1. A home page or root route.
    • If the user is not logged in, the page should show them a login link.
    • If the user is logged in, the page should say, "hi, #{name}", and provide a logout link.
  2. A login page
    • Users can enter their name in a form and click 'login'. Thereafter, the app will refer to them by that name.
    • If the user does not enter a name, they are not logged in. Return them to the login page.

Instructions

  1. Create the sessions controller.

    Note: If you use the generators to generate your controllers, be sure to pass these flags to avoid generating unneeded files and routes: rails generate controller Sessions new --no-helper --no-assets --no-test-framework --skip-routes --skip. (For those who are curious, the --skip tag prevents the generator from conflicting with existing files.)

  2. Write the new, create, and destroy methods.

  3. Ensure that your tests pass!

View Sessions Controller Lab on Learn.co and start learning to code for free.

sessions_controller_lab-sfo01-seng-ft-042020's People

Contributors

maxwellbenton avatar queerviolet avatar dependabot[bot] avatar victhevenot avatar danielseehausen avatar mendelb avatar blake41 avatar heavenlyboheme avatar drakeltheryuujin avatar rrcobb avatar sgharms avatar sylwiavargas avatar ahimmelstoss avatar lkwlala avatar sdcrouse avatar

Watchers

 avatar  avatar Bernard Mordan avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar  avatar  avatar Ben Oren avatar Matt avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Dominique De León avatar  avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar

Forkers

tharveybrown

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.