2
I have a registration form using Rails, where after the user completes the registration, it is redirected to the login page along with a flash[:success]
that shows a welcome message.
My doubt is whether there would be any way in the proper Rails to make that flash[:success]
disappear after x seconds?
Or you’d better do it using javascript?
Follows code:
Userscontroller
def create
@user = User.new(user_params)
if @user.save
flash[:success]= "Cadastro realizado com sucesso!"
redirect_to sign_in_path
else
render action: :new
end
end