title: Passing an optional parameter in formtastic url
body: <p>I have a rails view for a new action. I am using formtastic to generate the form, and I optionally have a proforma template that may have been passed to the controller.</p>
  
  <p>What I want to do is make sure this proforma_id gets passed through to the create method when the form is submitted</p>
  
  <p>I've found a way to do it but I want to know if this is a bit hackish and if there isn't a cleaner more ruby-like way of doing it:</p>
  
  <pre><code>&lt;% params = {:proforma_id =&gt; @proforma.id} unless @proforma.nil? %&gt;
  &lt;%= semantic_form_for @document, :url =&gt; documents_path(params) do |f| %&gt;
  </code></pre>
  
  <p>Maybe I should just put the params line in the controller ?</p>