How can I make my form for submit all at the same time when I click the link_to "save". Thank you for your answers. This is a snippet of my view file. I would like to save form for at the same time with one button.
<% @sheets.each do |getsheets| %>
<%= image_tag "sheets/#{getsheets.sheetimage.split('/')[-2]}/#{getsheets.sheetimage.split('/')[-1]}" %>
<div>
<%= form_for getsheets , :url => sheet_attachment_path(getsheets.sheetid,getsheets.sheetid) do |f| %>
<%= f.label :"Name: " %>
<%= f.text_field :name %>
<%= f.hidden_field :sheetid, :value => getsheets.sheetid %>
<%= f.hidden_field :projectid, :value => getsheets.projectid %>
<%= f.hidden_field :sheetimage, :value => getsheets.sheetimage %>
<% end %>
<%= link_to "Destroy Sheet", delete_sheet_path(getsheets.sheetid,params[:attachmentid]) %>
</div>
<br>
<% end %>
<div>
<%= link_to "Save", "#"%>
<%= link_to "Cancel", :controller => "sheet_attachments", :action => "cancel", :attachmentid => params[:attachmentid] %>
</div>