= dm-is-select A DataMapper plugin that makes getting the options array [ [nil, "Choose Parent"], ["nil", " ------ "], [0, "Top Level Category"], ["nil", " ------ "], [1, "Parent-1"], [2, "-- Parent-1-Child"], [3, "-- -- Parent-1-Child-GrandChild"], [4, "Parent-2"], [5, "-- Parent-2-Child"], [6, "-- -- Parent-2-Child-GrandChild"] ] NB! It only supports 3 levels at this point in time, as I think that's enough in most use cases, but IF not, fix the code and let me know and I'll add it. Cool, but that "Top Level Category" node is a bit ugly, but easily fixed. Category.items_for_select_menu( :root_text => "1st Parent (root)" ) ...gives you: [ ...... ["nil", " ------ "], [0, "1st Parent (root)"], ["nil", " ------ "], ...... ] You can even remove it all together by doing this: Category.items_for_select_menu( :show_root => false ) Obviously all the config options from above works with Tree models as well. == Last Few Words OK, I admit it, not the most impressive DM plugin there is, but hey, it sure helps keeping your model/views cleaner. == RTFM For a better understanding of this gem/plugin, make sure you study the 'dm-is-select/spec/dm-is-select_spec.rb' file. == Errors / Bugs If something is not behaving intuitively, it is a bug, and should be reported. Report it here: http://github.com/kematzy/dm-is-select/issues == Contributing to dm-is-select * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it. * Fork the project. * Start a feature/bugfix branch. * Commit and push until you are happy with your contribution. * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. == Copyright Copyright (c) 2009 - 2013 Kematzy. == Licence Released under the MIT license.