new demo link on home page
This commit is contained in:
parent
fbeb503d9e
commit
cbb5737fdf
5 changed files with 12 additions and 7 deletions
|
@ -2,8 +2,8 @@ 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'
|
||||
@user = User.new(email: DemoEmails[:admin], password: 'password')
|
||||
render 'users/sessions/new'
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -2,8 +2,8 @@ class Gestionnaires::SessionsController < Sessions::SessionsController
|
|||
def demo
|
||||
return redirect_to root_path if Rails.env.production?
|
||||
|
||||
@gestionnaire = Gestionnaire.new(email: 'gestionnaire@apientreprise.fr', password: 'password')
|
||||
render 'new'
|
||||
@user = User.new(email: DemoEmails[:gestionnaire], password: 'password')
|
||||
render 'users/sessions/new'
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -4,8 +4,7 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
def demo
|
||||
return redirect_to root_path if Rails.env.production?
|
||||
|
||||
@user = User.new(email: 'demo@tps.fr', password: 'password')
|
||||
|
||||
@user = User.new(email: DemoEmails[:user], password: 'password')
|
||||
render 'new'
|
||||
end
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
.actions
|
||||
= f.submit "Se connecter", class:'btn btn-primary'
|
||||
%br
|
||||
= render "users/shared/links"
|
||||
- if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin]
|
||||
= render "users/shared/links"
|
||||
|
||||
|
||||
|
||||
|
|
5
config/initializers/demo_emails.rb
Normal file
5
config/initializers/demo_emails.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
DemoEmails = {
|
||||
user: 'demo@tps.fr',
|
||||
gestionnaire: 'gestionnaire@apientreprise.fr',
|
||||
admin: 'admin@tps.fr'
|
||||
}
|
Loading…
Reference in a new issue