Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Parameter Modification

Right, so I had a look and tried on other forums and sat and had a good think about it but cannot figure out what I'm doing wrong. I tried various combinations and now I'm getting myself all twisted up.

Question: Delete the :user_id key from the params[:status] hash if it exists.

Code from other forum.

if params.has_key?(:status)
  params.delete(:status)
end

My thought was to do the following

if params.has_key?(:status)
  params.delete(:user_id)
end

Help please :(

1 Answer

Got it

Rodrigo Soares
Rodrigo Soares
2,460 Points

I'm stuck on that problem, I know this was a long time ago but can you remember what you did to make it pass?

Thanks a lot.