我如何使表格具有belongs_to和has_many关系(使用formtastic)?

| 这是我目前的表格。目前,我不认为这是在添加/创建帐户记录:
  1 = semantic_form_for @message do |f|
  2   #message_form
  3     = f.error_messages
  4     %p
  5       = f.autocompleted_input :account, :url => autocomplete_account_name_messages_path
  6     %p
  7       = f.input :subject
  8       %br
  9       = f.input :body, :as => :text, :input_html => { :class => \'autogrow\', :rows => 5, :cols => 20, :maxlength => 10  }
 10     = hidden_field_tag :sender_id, params[:sender_id]
 11     = hidden_field_tag :receiver_id, params[:id]
 12     
 13     = f.buttons do 
 14       = f.commit_button \'Give\'
 15       = f.commit_button \'Request\'
 16     
 17   #add_contact_btn
 18     = link_to \"Add Contact\", new_contact_path
 19       
 20     #contact_form
 21       = form_for @contact do |fc|
 22         %p
 23           = fc.label :first_name
 24           %br
 25           = fc.text_field :first_name
 26         %p
 27           = fc.label :last_name
 28           %br 
 29           = fc.text_field :last_name
 30   
    
已邀请:

要回复问题请先登录注册