Hey,
I was thinking I’d have my controllers do double-duty: the same actions handling json and html requests differentially. For this, it’s useful that Rails 3.2 automatic params hash conversion from json work (as described here in the Rails docs). (I’m using ruby 1.9.2.) But it doesn’t, that is, it seems I am required to decode the json params explicitly. Why?
Here’s an example of a post from my dev log…
Processing by MarketlessPriceRequestsController#create as JSON
Parameters: {“utf8”=>“✓”, “price_request”=>"{"prices_are_public_to_pricemakers":false, …
Here’s params[:price_request] in the controller
{“prices_are_public_to_pricemakers”:false, …
But it looks like I need to decode the json explicity to get to the accepted form…
{“prices_are_public_to_pricemakers”=>false, …
Can I configure my controllers to help me avoid the explicit decode step?
Thanks,
G