• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Lib file state_select.rb

If you are not interested in installing a plugin just for one method(state_select) then You can put state_select.rb file in you rails lib directory. And include state_select.rb file in your controller where ever you want to use state_select method.

The url for state_select.rb is http://github.com/bansalakhil/stateselect/tree/master/lib/state_select.rb
Feedback please….

7 Responses so far.

  1. Garth says:

    Should upcase the country name when appending _STATE to it.

    Also need some adjustments to the Canadian provinces:

    ["Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland", "Northwest Territories", "Nova Scotia", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon"],

    Otherwise, looks nice!

  2. Garth says:

    Also missed Alaska and need to sort the US state names properly

  3. Akhil Bansal says:

    Thanks Garth,
    I will definitely do it

  4. Garth says:

    One more thing: “Missourri” should only have one “r”.

  5. Daniel McQuillen says:

    Thanks for the state_select plugin!

    However, when I run script/plugin it installs your plug to /vendor/plugins/trunk

    Other plugins I want to install (file_column) write to the same directory /vendor/plugins/trunk, overwriting your files.

    Is this correct behavior? Shouldn’t the plugin install to something like /vendor/plugins/state_select ?

    I’m a rails newb so I might be missing something here.

    Thanks again for your hard work.

    Daniel
    Oakland, CA

  6. Akhil Bansal says:

    Hi Daniel,
    Please rename the trunk dir to state_select just after you install the plugin ;-)


Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...

Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...