title: Rails get list of types (enum)
body: <p>in my model i have this part of code for declare hard coded types</p>
  
  <pre><code>TYPES = { administrator: 1, system: 2, station: 3, guest: 4 }
  
      def type
        TYPES.key(read_attribute(:type_id))
      end
  
      def type=(s)
        write_attribute(:type_id, TYPES[s])
      end
  </code></pre>
  
  <p>i need get this 4 types on the view to show them as select box
  how can i get them</p>
  
  <p>somthing like that</p>
  
  <pre><code>Admin.TYPES.each do |type|
  "&lt;option id="&lt;%=????%&gt;"&gt;&lt;%=type.text%&gt;&lt;/option&gt;"
  end
  </code></pre>