Skip to content

Instantly share code, notes, and snippets.

@panSarin
Created July 19, 2012 17:47
Show Gist options
  • Save panSarin/3145598 to your computer and use it in GitHub Desktop.
Save panSarin/3145598 to your computer and use it in GitHub Desktop.
User with nested attributes , error on password problem
= simple_form_for [:admin, @user], remote: true, html: { novalidate: 'true'} do |f|
.tab-content
#basic.tab-pane.active
= f.input :login
= f.simple_fields_for :password_attributes do |pass|
= pass.input :password, label: 'Hasło'
= pass.input :password_confirmation, label: "Potwierdzenie hasła"
= pass.input :user_id, as: :hidden, input_html: {value: @user.id }, wrapper: :default
#personal.tab-pane
= f.simple_fields_for (@user.persisted? ? :personal : :personal_attributes), @user.personal do |p|
= p.input :pesel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment