I am trying to post JSON object in the user table but unable to post it. I can successfully add the JSON object manually in the in the database using insert SQL command in psql. But when I do it through ruby I get no error but the field is not updated.
Here is the code I wrote in the app.rb file.
------------ create user account ------------
get "/account_creation" do
slim :account_creation
end
post "/account_creation" do
opts = {
balance: 200,
name: params["username"],
email: params["useremail"],
password: SecureRandom.hex(2),
jfields: '{"skill": "Java"}'
}
FB.create(:user, opts ).user
end
With this code balance, name, email and password field gets updated but jfields is not updating.