Say I have a model like so:
class Animal
include DataMapper::Resource
property :id, Serial
property :type, Enum[ :cat, :bat, :rabbit, :zebra]
end
Assuming there is a route pointing to an erb template for adding more animals & @animal = session[:animal]
how would I create a list of animal types?
...
<form>
<% @animal.type.each do |animal| %>
<select>
<option value="<%= @animal.type" %></option>
</select>
<% end %>
</form>
(Obviously that bit of code doesn't do what I am looking for, but I hope it makes it a little more clear.)