I’ve been trying to do it from memory something like this, but it’s not working it keeps returning rollback and false
a=Admin.create a=Admin.find(1) a.email="user@host.com" a.password=“password” a.save
I’ve been trying to do it from memory something like this, but it’s not working it keeps returning rollback and false
a=Admin.create a=Admin.find(1) a.email="user@host.com" a.password=“password” a.save
If you are using Devise or anything like it, you may need to also have password_confirmation = "password" in order to get past that requirement.
Walter
It is getting rather tedious repeatedly pointing you to where in railstutorial.org you can find the solution to the questions you ask. In this case the answer is in section 6.1.3 Creating user objects.
I can only suggest once again that you take a couple of days out and work right through that tutorial, including doing all the exercises. Then you would not need to waste your time asking such questions.
Colin