Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date_select and devise 1 error(s) on assignment of multiparameter attributes #1599

Closed
suely opened this Issue Jan 25, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@suely
Copy link

commented Jan 25, 2012

using ruby 1.9.2, rails 3.1.3, devise 1.5.3

IN MY REGISTRATIONS/NEW I HAVE:

<%= f.label :fecha_de_vencimiento %>
<%= f.date_select :fecha_vencimiento, {:start_year => 2011, :end_year => 2050, :include_blank => true} %>

WHEN THE USER TRY TO SIGN UP, I GET::

ActiveRecord::MultiparameterAssignmentErrors in Devise::RegistrationsController#create

1 error(s) on assignment of multiparameter attributes
Rails.root: C:/Ruby192/sitiowebandinatech/encuestador2

Application Trace | Framework Trace | Full Trace
Request

Parameters:

{"utf8"=>"✓",
"authenticity_token"=>"ObzcNjdTP71I7UICNipkuy9g9Q2QEZlzXrn3imfWB+k=",
"user"=>{"tipo_tarjeta"=>"visa",
"numero_tarjeta"=>"1111111",
"nombre_en_tarjeta"=>"juan",
"fecha_vencimiento(1i)"=>"1901",
"fecha_vencimiento(2i)"=>"1",
"fecha_vencimiento(3i)"=>"1",
"cvv"=>"1234",
"nombre"=>"juan",
"apellidos"=>"perez",
"mail_facturacion"=>"juan@gmail.com",
"mail_facturacion_alternativo"=>"otro@gmail.com",
"nombre_empresa"=>"juanito limitada",
"pais"=>"Chile",
"direccion"=>"av siempre viva 123",
"ciudad"=>"santiago ",
"codigo_postal"=>"123123",
"numero_telefono"=>"2651313",
"numero_orden_compra"=>"100000",
"email"=>"juanito@gmail.com",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"},
"commit"=>"Registrarse"}

@josevalim

This comment has been minimized.

Copy link
Member

commented Jan 25, 2012

Unlikely to be a Devise issue. Is "fecha_vencimiento" a datetime/timestamp column in your database?

@suely

This comment has been minimized.

Copy link
Author

commented Jan 25, 2012

mi migration:
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable

  # t.encryptable
  t.confirmable
  t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
  t.token_authenticatable

  t.string :tipo_tarjeta
  t.string :numero_tarjeta
  t.string :nombre_en_tarjeta
  t.string :fecha_vencimiento
  t.string :cvv
  t.string :nombre
  t.string :apellidos
  t.string :mail_facturacion
  t.string :mail_facturacion_alternativo
  t.string :nombre_empresa
  t.string :pais
  t.string :direccion
  t.string :ciudad
  t.string :codigo_postal
  t.string :numero_telefono
  t.string :numero_orden_compra

  t.timestamps
end

add_index :users, :email,                :unique => true
add_index :users, :reset_password_token, :unique => true
add_index :users, :confirmation_token,   :unique => true
add_index :users, :unlock_token,         :unique => true
add_index :users, :authentication_token, :unique => true

end

end
***I need to change fecha_nacimiento" to datetime or timestamp??? sorry I'm a beginner, a partir de jà muito obrigado!!!

@josevalim

This comment has been minimized.

Copy link
Member

commented Jan 25, 2012

t.datetime will be fine. I recommend you to take a look at the Rails guides and properly model your data.

@josevalim josevalim closed this Jan 25, 2012

@suely

This comment has been minimized.

Copy link
Author

commented Jan 25, 2012

I'll start over, I know what I did...when I defined my model, I wrote fecha_vencimiento:string and not fecha_vencimiento:datetime doh!!! beginner issue...thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.