我有 link_to,当我单击链接时,显示 div(id="edit_comment_form")(此 div 是用户编辑内容的表单),我想将 params[:cc] 从 link_to 传递给 div 这是源代码。
<%= link_to "Edit", "#edit_comment_form", :class => "btn", "data-toggle" => "modal" %>
<div id="edit_comment_form" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<%= form_tag({controller: "comments", action: "edit"}, method: "get", class: "xxx") do %>
<div class="modal-body">
<%= text_area_tag :comment, "" ,rows: 10,:style => "width:515px; resize: none;",:placeholder => "Please type your comment." %>
<%= hidden_field_tag(:cc, params[:cc]) %> ### I want params[:cc]
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<%= submit_tag "Vote",:class => "btn btn-primary" %>
</div>
<% end %>
我如何将参数传递给 div。请帮我!