aboutsummaryrefslogtreecommitdiffstats
path: root/003-Authentification.md
diff options
context:
space:
mode:
authorTeddy Wing2017-07-25 22:54:40 +0200
committerTeddy Wing2017-07-25 22:54:40 +0200
commit1b5ea95633912282ea45c766e60853dc957398d0 (patch)
treecd582c66e8fb1522e147064301b30baa8307fac5 /003-Authentification.md
downloadDeux-Scoops-Rails-Tutorial-1b5ea95633912282ea45c766e60853dc957398d0.tar.bz2
Initial commit. First version of tutorial.
Includes: * Prerequisite installation procedures * Project setup * Ice Cream model and page display * Authentication * Creating a model via the interface * A Rails command reference Desired additions: * Editing ice creams (only by users who created them) * Comments on ice creams * Ratings of ice creams * Maybe some info about the asset pipeline
Diffstat (limited to '003-Authentification.md')
-rw-r--r--003-Authentification.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/003-Authentification.md b/003-Authentification.md
new file mode 100644
index 0000000..14bd1cd
--- /dev/null
+++ b/003-Authentification.md
@@ -0,0 +1,37 @@
+Authentification
+================
+
+On va utiliser la gem [Clearance](https://github.com/thoughtbot/clearance) pour
+nous donner de l'authentification.
+
+
+1. Ouvrez le `Gemfile` et ajoutez cette ligne :
+
+ gem 'clearance'
+
+2. Utilizes Bundler pour installer la gem :
+
+ bundle install
+
+3. Pour installer Clearance, faitez :
+
+ rails generate clearance:install
+
+4. Lancez les migrations :
+
+ rails db:migrate
+
+5. Relancez le serveur Rails
+
+4. Ajoutez cet HTML (copiƩ du README de Clearance) dans le `<body>` du
+ `layouts/application.html.erb` :
+
+ <% if signed_in? %>
+ <%= current_user.email %>
+ <%= button_to "Sign out", sign_out_path, method: :delete %>
+ <% else %>
+ <%= link_to "Sign in", sign_in_path %>
+ <% end %>
+
+4. Inscription et connexion sont maintenant possibles depuis l'interface web de
+ l'application.