title: Simple hidden field in non-model form
body: <p>What's the simplest way in Ruby-on-Rails to create several simple hidden fields with known values and the same name in a number of non-model forms (form_remote_tag in my case, but I'm guessing that isn't relevant)? </p>
  
  <p>By "simple hidden field", I mean one where the name is just a single string (<code>field_name</code>) rather than part of an array (<code>field_name[]</code>), so that the value can be read simply from the params hash as <code>params[:field_name]</code> rather than <code>params[:field_name][0]</code>.</p>
  
  <p>I have found that</p>
  
  <pre><code>&lt;% form_remote_tag :url =&gt; {:action =&gt; "do_act"} do %&gt;
    &lt;%= hidden_field :field_name, 0, :name =&gt; "field_name", :value =&gt; "foo" %&gt;
    &lt;%= submit_tag "Submit" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>produces an acceptable element (<code>&lt;input id="field_name_0" name="field_name" type="hidden" value="foo" /&gt;</code>), but if I omit the <code>:name</code> parameter then the rendered field has the name <code>field_name[0]</code>. Omitting the <code>0</code> obviously causes really odd behaviour.</p>
  
  <p><code>&lt;%= hidden_field_tag :field_name, "foo" %&gt;</code> produces an acceptable element if there's only one such form, but generates HTML warnings (duplicate IDs) if there are more than one.</p>
  
  <p>Is there a way to do this (barring defining a helper) in fewer arguments?</p>