I followed the first option to create an Admin role as recommended here https://github.com/plataformatec/devise/wiki/How-To:-Add-an-Admin-Role
After that, I created a seed to populate the Admin Model:
Admin.create!([{email: "[email protected]"},
{password: "password"},
{password_confirmation: "password"}])
Admin Model
class Admin < ApplicationRecord
devise :database_authenticatable, :trackable, :timeoutable, :lockable
end
Routes
Rails.application.routes.draw do
devise_for :admins
end
I tried to sign_in with this password at /admins/sign_in without sucess.
At the rails console I can see the Admin.first, so i don't have idea what im doing worng. Any idea?