Adds a sign in box to your login page to allow automatic sign in. Useful in development environments.
- Add
gem 'rails_easy_sign_in'
to the development group of the Gemfile and bundle. - Add
rails_easy_sign_in.js
andrails_easy_sign_in.css
to config.assets.precompile. - Add the following to app/views/layouts/application.html.haml
- if Rails.application.config.should_show_easy_login
= stylesheet_link_tag "rails_easy_sign_in"
= javascript_include_tag "rails_easy_sign_in"
- Add
config.should_show_easy_login = false
to config/application.rb - Add
config.should_show_easy_login = true
to config/environtments/development.rb - Add the following to app/views/devise/sessions/new.html.haml
- if Rails.application.config.should_show_easy_login
.easy-sign-in
= link_to 'Sign in as Administrator', '#', data: { email: "[email protected]", password: "password" }
= link_to 'Sign in as Member', '#', data: { email: "[email protected]", password: "password" }