xinuc / province-select

Simple plugin to select a list of Indonesian provinces.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Province Select

Simple plugin to select a list of Indonesian provinces.
This plugin can be integrated with Formtastic easily.

Example

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 -%>

Formtastic Integration

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

About

Simple plugin to select a list of Indonesian provinces.

License:MIT License


Languages

Language:Ruby 100.0%