title: How to display month and year selection for credit card
body: <p>I am using Rails 3.1 . Here is the code I have which asks user to enter credit card expiration month and year. </p>
  
  <pre><code>  &lt;div class="field"&gt;
      &lt;%= f.label :expires_on, 'Expiration date' %&gt;
      &lt;br /&gt;
      &lt;%= select_month nil, {add_month_numbers: true}, {name: 'creditcard[month]', id: "card_month"} %&gt;
      &lt;%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: 'creditcard[year]', id: "card_year"} %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Above code works. However the issue is that if there was a validation error then the selected expiration and month are reset. </p>
  
  <p>I tried <code>f.select_month</code> but that is not supported.</p>