Simple plugin to select a list of Indonesian provinces.
This plugin can be integrated with Formtastic easily.
Suppose you have address
model with province
attribute as a string,
you can use province_select
like:
<%- form_for(@address) do |f| -%> <p> <%= f.label :province %> <%= province_select "address", "province" %> </p> <p> <%= f.submit 'Create' %> </p> <%- end -%>
If you’re using formtastic you can just simply write:
<%- semantic_form_for(@address) do |f| -%> <%= f.inputs :province %> <%= f.buttons :commit %> <%- end -%>
And it’ll just work.
Copyright © 2009 Nugroho Herucahyono, released under the MIT license