ruby on rails - Need two addition fields to be added in devise form used and saved in different table(invite table) -


I have a sign up form for using Davis in ROR. It requires adding nested form. But I am not able to add it ... anyone can help me to solve it. The form below preserves the user, but I want to add two fields to save it in the invited table. Will ...

 % H2 sign up = for form_ (s) Means ,: as = & source; Snsadn_nam ,: url = & gt; Panjikrn_path (resource_name)) f | F | = Devise_error_messages! .form-group% div = f.label: first_name ,: class = & gt; "Control-label"% br / = f.text_field: first_name ,: autofocus = & gt; True ,: class = & gt; "Form-control-narrow controls". Form-group% div = f.label: last_name ,: class = & gt; "Control-label"% br / = f.text_field: last_name ,: class = & gt; "Form-Control Narrow Control" .form-groups% div = f.label: email ,: class = & gt; "Control-label"% br / = f.email_field: email ,: class = & gt; "Form-Control Narrow Control"% br / .form-group% div = f.submit "sign up" ,: class = & gt; "BTN BTN-Default"   

I need two fields (name, invitation) below to be added to the form above and invite them to the table ...

  .form-group% div = f.label: name, "your name (required)" ,: class => "Control-label"% br / = f.text_field: name ,: class = & gt; "Form-Control Narrow Control" .form-groups% div = f.label: Invite, "Your Invitation (Required)" ,: class = & gt; "Control-label"% br / = f.text_field: Invite,: class = & gt;   

Can anyone help in deciding it?

Sign_up) do | u | U.Permit (: first_name ,: last_name ,: email, nested_attributes: [: name,: invite]) end

nest E you must specify here the name of the model instead.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -