Problem with rails-api dont save in data base

65 views
Skip to first unread message

Alessandro Binhara

unread,
Mar 27, 2014, 11:55:51 PM3/27/14
to rails-a...@googlegroups.com
Hello ... 
i have a simple problem.  I genereate a simple aplication in rails-api ... and it works
but when a try make a post with data .. it save null in all records.. it dont pass valeu to my SQL see : 

SQL (2.9ms)  INSERT INTO "hidrometros" ("created_at", "updated_at") VALUES (?, ?)  [["created_at", Fri, 28 Mar 2014 03:46:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 03:46:55 UTC +00:00]]
   (6.2ms)  commit transaction

What is wrong??


Here all log ... 
thanks

binhara-VirtualBox wsleitor # rails s
=> Booting WEBrick
=> Rails 4.0.3 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-03-28 00:46:36] INFO  WEBrick 1.3.1
[2014-03-28 00:46:36] INFO  ruby 1.9.3 (2012-04-20) [x86_64-linux]
[2014-03-28 00:46:36] INFO  WEBrick::HTTPServer#start: pid=3330 port=3000
DEPRECATION WARNING: You didn't set config.secret_key_base. Read the upgrade documentation to learn more about this new config option. (called from service at /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138)


Started GET "/hidrometros" for 127.0.0.1 at 2014-03-28 00:46:45 -0300
  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by HidrometrosController#index as JSON
  Hidrometro Load (0.2ms)  SELECT "hidrometros".* FROM "hidrometros"
Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.6ms)


Started POST "/hidrometros" for 127.0.0.1 at 2014-03-28 00:46:55 -0300
Processing by HidrometrosController#create as */*
  Parameters: {"task"=>{"barcode"=>"33333", "nomefoto"=>"3333", "dados"=>"33333", "data"=>"3333"}}
   (0.1ms)  begin transaction
  SQL (2.9ms)  INSERT INTO "hidrometros" ("created_at", "updated_at") VALUES (?, ?)  [["created_at", Fri, 28 Mar 2014 03:46:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 03:46:55 UTC +00:00]]
   (6.2ms)  commit transaction
Completed 201 Created in 47ms (Views: 1.3ms | ActiveRecord: 9.2ms)
^C[2014-03-28 00:50:18] INFO  going to shutdown ...
[2014-03-28 00:50:18] INFO  WEBrick::HTTPServer#start done.
Exiting

Reply all
Reply to author
Forward
0 new messages