I'm making a form that will have several fields and one of them should have default value wich is not visible if the resource is being created. But if it is being edited the field should be shown. So I try something like this:
<%= form_for(@task) do |f| %>
<div class="field" id="v_field">
<%= f.label :v_field, "Always visible field." %>
<%= f.text_field :status %>
</div>
<% if params[:action] != "new" %>
<div class="field" id="default_field">
<%= f.label :default_field, "Default field (should be invisible for new resources only)." %>
<%= f.text_field :status %>
</div>
<% end
<% end %>
But it doesn't work. Also I've tried to change controller settings like this:
format.html { :except => [:default_field] }
But it doesn't work.
Please tell me, what comparison should I use in the condition? Thanks.