/THP_Day19

Primary LanguageRuby

THP_Day19 : First site with backend

We had to make a site that allows us to create users.

1. Databases

We have generated and created a user model with 2 attributes : username and bio

2. The first pages

We have created a homepage connected to root and controller static_pages

3. User creation

Our homepage redirect to users_controllers#new and we did the view

  • The form : is a classic HTML form who is asking username in input and bio in texarea
  • The 'routes' : we have connect the form to correct route by creating method create
  • Play with params : we have recovers the informations to create somes users for fun
  • The redirection : we have redirect the user once the forms is submitted with the method : redirect_to

4. Profil page for users

We have create a profile page for all our users (we don't forget you!)

  • Profile page creation : we have create a route that takes into account /users/id_user then redirect it to the method : show
  • Redirection to the profile page : this allows you to redirect to your profile page rather than root

5. A real username

We wanted you to have a real personal name in this cruel world ^_^

  • Validations : as Félix would say validations is called validations...
  • Rediction : there we made sure that when you do not know how to type your name it guides you step by step (also if your name has already been taken by another avenger) 😃
  • /users/username : that's really cool it allows you to see your super nick in the url of your page guy like this : /users/catwoman

Now

Sign up on our super cool site after getting our work on github and have a little bundle install in the folder

Thank you very much the correctors handsome kids

Team

Realized by Cyril M. & Pacôme P, the Caen team !