Parsing params that includes json string in rails controller
<p>In a react-native app, I have the following post request that goes to a rails controller</p>

<pre><code>  fetch(POST_PAID_UP, {
    method: 'POST',
    body: JSON.stringify({
      receipt_num: 127,
      }).replace(/{|}/gi, "")
  })
</code></pre>

<p>In the appropriate action of my rails controller I can examine params it looks like this;</p>

<pre><code>{"\"receipt_num\":127"=&gt;nil, "controller"=&gt;"ios/accounts", "action"=&gt;"create"}
</code></pre>

<p>so the data is being received. From params I need to extract the value of 'receipt_num'.  I have tried <code>JSON.parse(params)</code>, but I receive this error;</p>

<pre><code>TypeError: no implicit conversion of Array into String
</code></pre>

<p>So how should I parse this data?</p>