Reputation: 31
I purely set up the sign-up page using gem:
controller:
class HomeController < ApplicationController
def index
unless user_signed_in?
redirect_to "/users/sign_in"
end
end
end
model:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
end
However, the error message doesn't show up whenever I use invaild username or password. The page remains same and nothing happens. What I need to show up error message? thanks.
Upvotes: 1
Views: 139
Reputation: 16507
In a view just set up after the form tag #devise_error_messages!
method:
edit.html.slim:
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= devise_error_messages!
Upvotes: 0