# Modifying Params Hash

**URL:** <https://www.ruby-forum.com/t/modifying-params-hash/183432>\
**Category:** Rails\
**Created:** [February 13, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/modifying-params-hash/183432 "2010-02-13T23:16:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [February 13, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/modifying-params-hash/183432/1 "2010-02-13T23:16:02Z")

</div>

Is there a way to modify the params hash?

I have an external service that is sending requests to me and I can  
not control they way they send the request. It is one flat hash and i  
would like to take some of values fromt he hash and then create a new  
record based on the remaining hash. Basically, i would like to remove  
the :action and :controller values as when i try to submit the whole  
hash to the actveirecord new method it complains by saying it does not  
recognize those as it should not.

Thanks.

---

<div class="post-metadata">

**Author:** ![tashfeen.ekram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@tashfeen.ekram](https://www.ruby-forum.com/u/tashfeen.ekram)\
**Post date:** [February 14, 2010, 2:41am UTC](https://www.ruby-forum.com/t/modifying-params-hash/183432/2 "2010-02-14T02:41:01Z")

</div>

tashfeen.ekram wrote:

> Is there a way to modify the params hash?
> 
> I have an external service that is sending requests to me and I can  
> not control they way they send the request. It is one flat hash and i  
> would like to take some of values fromt he hash and then create a new  
> record based on the remaining hash. Basically, i would like to remove  
> the :action and :controller values as when i try to submit the whole  
> hash to the actveirecord new method it complains by saying it does not  
> recognize those as it should not.
> 
> Thanks.

Use delete\_if: [class Hash - RDoc Documentation](http://ruby-doc.org/core/classes/Hash.html#M002871)
