First look in development.log and check that the parameters are
correct in the request. If they look ok then debug the create method
and see where it is failing. You can easily do simple debugging by
inserting into the code things like
logger.info some_variable.inspect
Then that will appear in the log
I have just realised what you are trying to do. Are you trying to
save a hash object in a field in the database? I have never done that
as almost always you are better to use models and associations for
storing the data. That is the Rails way. If you really need to do
that then google for how to save a hash in the database using rails,
for how to use serialisers to do it.
I’ll very much second Colin’s first point: more analysis and better understanding of the data structures generally give better results. (i.e., more testable, extendable, maintainable, to my mind)
This store the date like {it:"value",de:"value"} and
this work.
I found the problem :
The default serialization that is YAML.
I don't know why this not working I try also only for see if Yaml have a
problem the instruction YAML.dump(params[:person][:birthplace]) and i
have the error !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nit:
like when save the data.
My problem is that there are another application that use YAML and i
want to merge the two database and is a problem because the format of
the fields are differents {} again string.
I don't know why this work in an application and not in this.