1

だから私はレールに不慣れで、少し問題があります。私の状況は、いくつかの画像が添付された製品モデルを持っているということです。製品ページに、ajax を介して新しい画像を作成するボタンを配置したいと考えています。

私の製品 _form ビュー内には、次のものがあります。

<%= simple_form_for(@product) do |f| %>
<%= f.error_notification %>
<div class="inputs">
<%= f.input :name %>
<%= f.input :description, :input_html => {:class => "wysihtml5 span6", :style => "height:400px;"} %>
<%= f.association :images, label_method: :name, value_method: :id %>
<h4>Upload new file</h4>
</div>
<%= link_to 'Add Image', '/images/new', :remote => true, :"data-replace" => "#image-form" %>
<div id="image-form">
</div>
<div class="actions">
  <%= f.button :submit %>
</div>
<% end %>

そして、ajax経由でページを正常にロードします。しかし、レイアウトなしでロードしたいと思います。これは可能ですか?部分的なフォームをレンダリングし、レイアウトを持たない新しいアクションを作成する必要がありますか??

4

2 に答える 2