I have a method to generate a password in models in Users.rb file. In my view i have a form where only email address filed is there and I want to to add the password to the User attribute before saving it. I have a create method where I create a new user and save it in controller. How do I call the generate password method in the controller?
Share
Is it a class method? Call it using
User.generate_password. Is it an instance method? Call it using@user.generate_password, or whatever the instance variable is named.