our site admin deleted his own id while deleting users ,what can i do
now to get back admin user can any one help,its urgent.
create new admin
using rails console create new admin… for instance, if you are having
user
model having role admin… you can create like
User.create(:email => “[email protected]”, :username => “admin”, :password
=>
“12345678”, :password_confirmation => “12345678”, :admin => true)…
I hope this will help
using rails console create new admin… for instance, if you are having
user
model having role admin… you can create like
User.create(:email => “[email protected]”, :username => “admin”, :password
=>
“12345678”, :password_confirmation => “12345678”, :admin => true)…
I hope this will help
On Thursday, February 26, 2015 at 12:13:54 PM UTC+5:30, Ruby-Forum.com
User
On 26 February 2015 at 06:54, ankit c [email protected] wrote:
using rails console create new admin… for instance, if you are having user
model having role admin… you can create like
User.create(:email => “[email protected]”, :username => “admin”, :password =>
“12345678”, :password_confirmation => “12345678”, :admin => true)…
The exact details will, of course, depend on exactly what fields you
have in your users table.
Having done that improve the code so that a user cannot delete either
himself or the last admin user.
Colin
ankit c wrote in post #1168678:
using rails console create new admin… for instance, if you are having
user
model having role admin… you can create like
User.create(:email => “[email protected]”, :username => “admin”, :password
=>
“12345678”, :password_confirmation => “12345678”, :admin => true)…I hope this will help
On Thursday, February 26, 2015 at 12:13:54 PM UTC+5:30, Ruby-Forum.com
User
okay thank you ,i will try this.