title: Save selected option to variable in rails
body: <p>I am making a calculator for a product price.
  I created method "calculator" in Products controller.</p>
  
  <p>My question is: how to save selected option to a variable, which i can use next?
  In calculator view I put following code: </p>
  
  <pre><code>&lt;%= select("product", "product_id", @products.collect {|p| [ p.title, p.id ] }, {prompt: 'Select Product'}) %&gt;
  </code></pre>
  
  <p>So, I select product in selector, and I want to save its id to variable. Next, I want to show product price throught this variable: variable.price.</p>
  
  <p>How can I do it? </p>