I've got a large data model in a Rails application that I'm trying to make serializable and output to JSON. I defined the #serializable_hash
method on the model and blacklisted a few attributes. My goal is to whitelist attributes on the controller layer to accept back that same structure and simply ignore values that I don't want "accessible".
One such attribute is giving me trouble when I PUT update
with the aforementioned JSON. I get an error while parsing request parameters:
SyntaxError (/Users/brad/.rvm/gems/ruby-1.9.3-p194@project-rails32/gems/actionpack-3.2.13/lib/action_dispatch/http/request.rb:261: syntax error, unexpected tINTEGER, expecting $end ...02933", "software_date"=>"09/05/14", "software_version"=>"10... ... ^): # stack trace...
As far as Rails is concerned, this is just a string right? Why is it expecting an end of input here? For the record, taking this attribute out before submitting my request results in a successful update, so I'm sure this is what's causing the issue.