Giter Club home page Giter Club logo

user-form-base's Introduction

Mini Assignment

Once you clone this repo perform the following steps:

bundle install
bin/rails db:setup
bin/rails s

You should now have the application running at http://localhost:3000

The Application

This is a user registration form. Here are some important files to keep in mind:

  • app/models/user.rb is the user model. validations and callbacks go here.
  • app/controllers/users_controller.rb is the user controller. action filters go here.
  • app/views/users/new.html.erb is the view template of the form. the errors need to be displayed here.
  • config/routes.rb shows you which resources and routes are available.

Your Mission

Go to http://localhost:3000/users/new

The form should have following fields, but no restrictions or validations. Use Rails validations to ensure a user doesn't register with invalid data. Note that all fields are required unless stated otherwise:

Field Restriction
First Name Must be between 2 and 60 characters
Last Name Must be between 2 and 60 characters
Username Must be unique. Must be between 2 and 20 characters
Email Must be unique. Must be a valid email.
Email Confirmation Must be the same as the email.
Password At least 8 characters. Must contain at least 1 number.
Password Confirmation Must the same as the password.
Password Hint Optional. Must be 100 characters max.

If there is an error in a field, redirect the user back to the form and display the error at the beginning.

If the user was created successfully, redirect the user to the index action.

Also, last names should be formatted following this logic:

Last Name Persisted Value
PUENTE Puente
puente Puente
de la quintana de la Quintana
De La Quintana de la Quintana
DEL PILAR del Pilar
Ponce De Leon Ponce de Leon

user-form-base's People

Watchers

James Cloos avatar

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.