我有一个 form_for 以下列方式编写:
<div class="field">
<%= location.label :city %>
<%= location.text_field :city, :disabled=>true%>
</div>
<div class="field">
<%= location.label :country %>
<%= location.text_field :country, :disabled=>true%>
</div>
如您所见,这 2 个文本字段被禁用,因为它们是由 jquery 函数自动填充的,我不想让用户处理它们。问题是,通过这种方式,视图不会将该参数传递给控制器,因为它被禁用了!!!有没有其他方法可以将不可编辑的 text_field 传递给控制器,注意我不想使用隐藏字段,因为我想在文本框中向用户显示结果
TNX