.html.erb 文件中有如下代码,我想控制当 value.custom_field.id 的值为 171 时让标签不可编辑,custom_field_tag_with_label 这个方法是在 helper 文件夹中写的,里面嵌套了一些方法, :disabled => true 是我自己加的,不好用
<% @project.custom_field_values.each do |value| %>
<%logger.info"#{value.custom_field.id}"%>
<% unless value.custom_field.id != '171' %>
<p><%= custom_field_tag_with_label :project, value , :disabled => true %></p>
<% end %>
=============================================================================================
<p><%= f.text_field :name, :required => true, :disabled => @project.admin_frozen?, :size => 60 %></p>