0
如何發送其他參數以及ID?傳遞參數連同ID
歷史控制器
def edit
@histories = History.find(params[:id])
end
def update
@histories = History.find(params[:id])
@histories.projects_lkp_id = params[:projects_lkps_id]
respond_to do |format|
if @histories.update(history_params)
format.html{ redirect_to histories_path(id: @histories.id), notice: "History updated successfully" }
else
format.html{ render 'edit' }
end
end
end
歷史/視圖/索引
<% @histories.each do |d| %>
<% d.pictures.each do |sAV| %>
<div><%= d.past %>
<%= link_to content_tag(:span, '', class: 'glyphicon glyphicon-pencil btn-xs'), edit_history_path(d) %></div>
<div class='col-md-4 col-sm-5'> <%=image_tag sAV.pic (:medium) %> </div>
<% end %>
<% end %>
我需要發送到projects_lkps_id與此線<%= link_to content_tag(:span, '', class: 'glyphicon glyphicon-pencil btn-xs'), edit_history_path(d) %></div>