Ruby on Rails
Friday, September 11, 2015
Here is the code you ask Colin:
_form
simple_form_for @pcp do |f|
= f.error_notification
.form-inputs.row.col-md-12
= f.input :name
= f.input :last
= f.input :phone1
= f.input :phone2
= f.input :bod
= f.input :esp
=f.simple_fields_for :medhospitals do |hospital|
= render 'medhospital_fields' , f: hospital, hindex: hcnt
= link_to_add_association 'Add a hospital', f, :medhospitals
.form-actions
= f.button :submit
_medhopital_fields:
.nested-fields.hosplital-fields
= f.association :hospital ,label: "Hosplital", collection: Hospital.all, label_method: :name, prompt: "Select Hospital"
= link_to_remove_association "Remove", f
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1d9f094a-5779-48b8-81b5-a66d7a3c527f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment