Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Ruby&;Rails 4-sqlite3保存DOB_Ruby On Rails_Ruby_Ruby On Rails 4_Devise_Sqlite - Fatal编程技术网

Ruby on rails Ruby&;Rails 4-sqlite3保存DOB

Ruby on rails Ruby&;Rails 4-sqlite3保存DOB,ruby-on-rails,ruby,ruby-on-rails-4,devise,sqlite,Ruby On Rails,Ruby,Ruby On Rails 4,Devise,Sqlite,我正在使用RubyGem“简单表单”注册用户。我正在为用户使用Ruby Gem“Desive”。 我的简单表格上的输入是: <%= f.input :dob, label: "Date of Birth", as: :date, start_year: Time.now.year - 13, end_year: Time.now.year - 90, order: [:day, :month, :year] %> 我将其保存为文本数据类型,因为我在网上看到sqlite3中没有日期数

我正在使用RubyGem“简单表单”注册用户。我正在为用户使用Ruby Gem“Desive”。 我的简单表格上的输入是:

<%= f.input :dob, label: "Date of Birth", as: :date, start_year: Time.now.year - 13, end_year: Time.now.year - 90, order: [:day, :month, :year] %>
我将其保存为文本数据类型,因为我在网上看到sqlite3中没有日期数据类型,但我可能错了

当我尝试保存我获得的信息时:

{"utf8"=>"✓",
 "authenticity_token"=>"9MpP91lDCMe/FT+SXrSJfpywYNgeqp7KU/TfalPkdJs=",
 "user"=>{"name"=>"guppy",
 "dob(3i)"=>"19",
 "dob(2i)"=>"12",
 "dob(1i)"=>"2001",
 "email"=>"branw@gmail.com",
 "password"=>"[FILTERED]",
 "password_confirmation"=>"[FILTERED]"},
 "commit"=>"Sign up"}
我想知道当用户注册时,如何成功地将生日(dob)保存给用户,而不给我错误信息:

1 error(s) on assignment of multiparameter attributes [error on assignment [19, 12, 2001] to dob (wrong number of arguments (3 for 0..1))]

非常感谢,我将数据类型更改为:date,它成功了。。。所以我猜日期是sqlite3中的一个东西。。。ffsI认为Rails希望扭曲的多部分格式进入一个日期,它可能不知道如何将其压缩成字符串。顺便说一句,SQLite将时间和日期存储为ISO8601格式的字符串,因为它没有本机日期或时间类型。
1 error(s) on assignment of multiparameter attributes [error on assignment [19, 12, 2001] to dob (wrong number of arguments (3 for 0..1))]