title: How to save a selected option to a variable/session/cookie in rails?
body: <p>I have a select tag in rails and i want to save the selected option so i can use it as a hidden_field value in multiple forms. </p>
  
  <p>I had no luck with cookies/session. </p>
  
  <p>All ideas are welcome :).</p>
  
  <p>For example, is this possible?</p>
  
  <pre><code>&lt;%= select_tag(session[:selected], options_for_select(...)) %&gt;
  </code></pre>
  
  <p>And then in multiple forms i ll have something like this:</p>
  
  <pre><code>&lt;%= f.hidden_field :time_frame, :value =&gt; session[:selected]%&gt;
  </code></pre>