Demo sign-in page for administrateur

This commit is contained in:
Guillaume Lazzara 2016-02-19 17:27:14 +01:00
parent bd5a39ff17
commit 973d6693e0
3 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,10 @@
class Administrateurs::SessionsController < Sessions::SessionsController
def demo
return redirect_to root_path if Rails.env.production?
@administrateur = Administrateur.new(email: 'admin@tps.fr', password: 'password')
render 'new'
end
def new
@administrateur = Administrateur.new

View file

@ -12,14 +12,14 @@
.input-group
.input-group-addon
%span.glyphicon.glyphicon-user
= f.email_field :email, class: 'form-control'
= f.email_field :email, class: 'form-control', value: @administrateur.email
%br
%h4
= f.label :password
.input-group
.input-group-addon
%span.glyphicon.glyphicon-asterisk
= f.password_field :password, autocomplete: "off", class: 'form-control'
= f.password_field :password, class: 'form-control', value: @administrateur.password
%br
%br
.actions

View file

@ -22,6 +22,9 @@ Rails.application.routes.draw do
get '/gestionnaires/sign_in/demo' => 'gestionnaires/sessions#demo'
end
devise_scope :administrateur do
get '/administrateurs/sign_in/demo' => 'administrateurs/sessions#demo'
end
root 'root#index'