Module: Categoryz3::FormHelpers
- Defined in:
- lib/categoryz3/form_helpers.rb
Instance Method Summary collapse
-
#categories_select(options = {}) ⇒ Object
Public: Creates a Select2 select box for choosing a category.
Instance Method Details
#categories_select(options = {}) ⇒ Object
Public: Creates a Select2 select box for choosing a category.
Options are:
{
unique: "Only 1 category per model", (Default false)
max_categories: "Max number of categories per model" (Default none)
html_options: "HTML options to be passed to the select field"
}
Example:
form_for @article do |f|
f.categories_select
end
21 22 23 24 |
# File 'lib/categoryz3/form_helpers.rb', line 21 def categories_select( = {}) categories_select = CategoriesSelect.new(@template, @object_name, ) categories_select.output end |