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 trialJon Goodey
33,092 PointsDelete the params[:status] hash if it exists in the params hash.
Delete the params[:status] hash if it exists in the params hash.
Write your code here.
if params[:status] params[:status].delete end
not sure what I am doing wrong here?
2 Answers
Jon Goodey
33,092 Pointsif params[:status]
params.delete
end
did not work I had to add the :status as a param to the delete method
if params[:status]
params.delete(:status)
end
Rodrigo Soares
2,460 PointsTry:
if params[:status]
params.delete
end
it should work but if it don't try to input the :status key after the delete method.