title: Editing params nested hash
body: <p>Assume we have a rails params hash full of nested hashes and arrays. Is there a way to alter every string value (whether in nested hashes or arrays) which matches a certain criteria (e.g. regex) and still keep the output as a params hash (still containing nested hashes arrays?</p>
  
  <p>I want to do some sort of string manipulation on some attributes <strong>before</strong> even assigning them to a model. Is there any better way to achieve this?</p>
  
  <p><strong>[UPDATE]</strong>
  Let's say we want to select the strings that have an h in the beginning and replace it with a 'b'. so we have: 
  before:
  <code>
  { a: "h343", b: { c: ["h2", "s21"] } }
  </code></p>
  
  <p>after:
  <code>
  { a: "b343", b: { c: ["b2", "s21"] } }
  </code></p>
  
  <p>For some reasons I can't do this with model callbacks and stuff, so it should have be done before assigning to the respective attributes.</p>