title: How to create select_box for a has_one relationship in rails?
body: <p>I have the following model:</p>
  
  <pre><code>class Platform &lt; ActiveRecord::Base
    has_many :stores, through: :store_platform_associations
  end
  </code></pre>
  
  <p>, </p>
  
  <pre><code>class StorePlatformAssociation &lt; ActiveRecord::Base
    belongs_to :store
    belongs_to :platform
  end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Store &lt; ActiveRecord::Base
    has_one :platform, through: :store_platform_association
  end
  </code></pre>
  
  <p>I'm developing a form to included a <code>Store</code> using <a href="https://github.com/plataformatec/simple_form" rel="nofollow">simple_form</a>.</p>
  
  <p>At this form, I'm trying to include a <code>Store</code> and let the user select one from many displayed platforms.</p>
  
  <p>To show available platforms, i'm using:</p>
  
  <pre><code>&lt;%= f.input :platform, collection: Platform.all %&gt;
  </code></pre>
  
  <p>But, when I submit the form, i'm getting this error message:</p>
  
  <pre><code>Internal Server Error
  expected Hash (got String) for param `platform'
  </code></pre>
  
  <p>What am I doing wrong?</p>