ブートストラップを使用した単純なフォームを使用して、レールでこのフォームを作成しました。
<%= simple_form_for @page, :html => { :class => 'page-form' } do |f| %>
<div class="row">
<%= f.input :title, wrapper_html: { class: 'span6'} %>
<%= f.input :url, wrapper_html: { class: 'span3'} %>
<%= f.input :content, input_html: { class: 'wysihtml5 span9' }, wrapper_html: { class: 'span9 row' } %>
<%= f.input :excerpt, input_html: { class: 'wysihtml5 span9 excerpt' }, wrapper_html: { class: 'span9 row'} %>
</div>
<% content_for :sidebar do %>
<div class="page-header">
<h1>Publish</h1>
</div>
<div class="well">
<%= f.input :status , collection: Page::STATUS.map { |s| [s.humanize, s] }, prompt: '- Select page status -' %>
<div class="form-actions">
<%= f.button :submit, :class => 'btn btn-primary' %>
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
pages_path, :class => 'btn' %>
</div>
</div>
<% end %>
<% end %>
問題は、送信ボタンがcontent_for
ブロック内にある場合、クリックしてもフォームが更新されないことです。このブロックの外にボタンがある場合は機能します。
content_for
ブロックするために内部で機能させる方法はありますか? サイドバーにある必要があります。
望ましい結果の写真:
ヒント、回答、または役立つコメントをいただければ幸いです :)