Modifying Params Hash

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.

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: http://ruby-doc.org/core/classes/Hash.html#M002871

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs