remove element from array

J

J. mp

Hi,
how can I do to rtemove an elemnt from an array,

I have this array :
"user"=>{"password_confirmation"=>"", "screen_name"=>"sdfsdfsdfsdf",
"first_name"=>"sdfsdfsd", "last_name"=>"dskkd", "password"=>"",
"email"=>"(e-mail address removed)"}

And I want to remove the elements "password_confirmation" and
"password".

How should I do this. I found nothing in docs, setting them to nil it's
not an option

thanks
 
J

J. mp

J. mp said:
Hi,
how can I do to rtemove an elemnt from an array,

I have this array :
"user"=>{"password_confirmation"=>"", "screen_name"=>"sdfsdfsdfsdf",
"first_name"=>"sdfsdfsd", "last_name"=>"dskkd", "password"=>"",
"email"=>"(e-mail address removed)"}

And I want to remove the elements "password_confirmation" and
"password".

How should I do this. I found nothing in docs, setting them to nil it's
not an option

thanks


sorry for making loosing your time. I'm a looser :)
it's from an Hash and not from and array
 
D

dblack

Hi --

sorry for making loosing your time. I'm a looser :)
it's from an Hash and not from and array

See the docs for Hash#delete, Hash#delete_if, and Hash#reject! (That
exclamation point is part of the method name.)


David

--
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)
 
J

J. mp

unknown said:
Hi --



See the docs for Hash#delete, Hash#delete_if, and Hash#reject! (That
exclamation point is part of the method name.)


David

I'm done!
Thanks David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top