Ruby on Rails Thursday, February 26, 2015

On 26 February 2015 at 06:54, ankit c <rubyrails9@gmail.com> 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 => "admin@admin.com", :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

>
> I hope this will help
>
> On Thu, Feb 26, 2015 at 12:11 PM, Sailatha K. <lists@ruby-forum.com> wrote:
>>
>> 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.
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/rubyonrails-talk/12a1a0d326d1d0ba9ae17c936129fbeb%40ruby-forum.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAB35-J63cs9FihR1Xsz-WK%2B0_RcNzFp3ZyNNkdA5vjNxJMUDzQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsF9zbWXEpGUN%2BRyK13kFdOCrFbQ-804c9MGe8C1_KORw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment