title: Trying to put an enum into a select form helper class in rails 5
body: <p>I have</p>
  
  <pre><code>&lt;%= f.select(:status, [["active", 0], ["inactive", 1], ['cancelled', 2]]) %&gt;
  </code></pre>
  
  <p>And originally </p>
  
  <pre><code>&lt;%= f.select(:status, collection: Subscription::STATUSES) %&gt;
  </code></pre>
  
  <p>But both don't work.</p>
  
  <p>Heres subscription.rb</p>
  
  <pre><code>class Subscription &lt; ApplicationRecord
    belongs_to :user
    belongs_to :plan
  
    STATUSES = {active: 0, inactive: 1, cancelled: 2}
    enum status: STATUSES
  end
  </code></pre>
  
  <p>Every time I try like this I get:</p>
  
  <pre><code>private method `select' called for nil:NilClass
  </code></pre>
  
  <p>And every time I try following guides I get that message for alternatively failing syntax.</p>
  
  <p>It's a headscratcher i'll leave until morning.</p>
  
  <p>You may want to see </p>
  
  <pre><code>&lt;%= form_tag subscription_path, id: "subscription-form" do |f| %&gt;
  </code></pre>
  
  <p>And therefore:</p>
  
  <pre><code>match "plans/subscriptions" =&gt; "subscriptions#new", as: "subscription", via: [:get, :post]
  </code></pre>