Demo sign-in page for administrateur
This commit is contained in:
parent
bd5a39ff17
commit
973d6693e0
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue