I have a registration form using Rails, where after the user completes the registration, he is redirected to the login page along with a flash[:success]
that shows a welcome message.
My question is if I had some form in Rails itself to make this flash[:success]
disappear after x seconds?
Or is it better to do this using javascript?
Following 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