0

以下代码未提交评论

.modal{ :id=>"#{digest.policy.id}", :class=>'modal hide'}
  .modal-header
    %h3
      = digest.policy.name
  .modal-body{ :style=>'display: block; height:200px;'}
    .modal-form
      = form_tag '/alerts/archive', :name=>"form#{digest.policy.id}", :remote=>'true' do
        = hidden_field_tag 'policy_id', digest.policy.id
        = hidden_field_tag 'parent_id', id
  .modal-footer
    #div{:style=>'text-align:left;'}Comment:
    = text_area_tag  'comment', '' , :cols=>'85', :rows=>'3'
    %a(data-toggle="modal" href="##{digest.policy.id}" class="btn" class="btn")Cancel
    %a(onclick="javascript:document.form#{digest.policy.id}.submit()" class="btn btn-primary")Archive
4

2 回答 2

0

您的 textarea 在表单标签之外。我建议将您的模式包装到表单元素中并使用普通的提交按钮。

例子:

= form_tag '/alerts/archive', :name=>"form#{digest.policy.id}", :remote=>'true' do
  .modal{ :id=>"#{digest.policy.id}", :class=>'modal hide'}
    .modal-header
      %h3
        = digest.policy.name
    .modal-body{ :style=>'display: block; height:200px;'}
      .modal-form
        = hidden_field_tag 'policy_id', digest.policy.id
        = hidden_field_tag 'parent_id', id
    .modal-footer
      #div{:style=>'text-align:left;'}Comment:
      = text_area_tag  'comment', '' , :cols=>'85', :rows=>'3'
      %a(data-toggle="modal" href="##{digest.policy.id}" class="btn" class="btn")Cancel
      = submit_tag "Archive", :class => "btn btn-primary"
于 2013-04-10T07:06:06.303 回答
0

成功!

= form_tag '/alerts/archive', :name=>"form#{digest.policy.id}", :remote=>'true' do
  .modal{ :id=>"#{digest.policy.id}", :class=>'modal hide'}
    .modal-header
      %h3
        = digest.policy.name
    .modal-body{ :style=>'display: block; height:200px;'}
      .modal-form
        = hidden_field_tag 'policy_id', digest.policy.id
        = hidden_field_tag 'parent_id', id
    .modal-footer
      #div{:style=>'text-align:left;'}Comment:
      = text_area_tag  'comment', '' , :cols=>'85', :rows=>'3'
      %a(data-toggle="modal" href="##{digest.policy.id}" class="btn" class="btn")Cancel
      %a(onclick="javascript:document.form#{digest.policy.id}.submit()" class="btn btn-primary")Archive
于 2013-04-21T05:09:07.950 回答