Module: Admin::FieldsHelper
- Defined in:
- app/helpers/admin/fields_helper.rb
Overview
Copyright © 2008-2013 Michael Dvorkin and contributors.
Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php
Instance Method Summary collapse
-
#field_edit_as_options(field = nil) ⇒ Object
Returns the list of :null and :safe database column transitions.
- #field_group_options ⇒ Object
Instance Method Details
#field_edit_as_options(field = nil) ⇒ Object
Returns the list of :null and :safe database column transitions. Only these options should be shown on the custom field edit form.
11 12 13 14 15 |
# File 'app/helpers/admin/fields_helper.rb', line 11 def (field = nil) # Return every available field_type if no restriction = (field.as.present? ? field.available_as : Field.field_types).keys .map { |k| [t("field_types.#{k}.title"), k] } end |
#field_group_options ⇒ Object
17 18 19 |
# File 'app/helpers/admin/fields_helper.rb', line 17 def FieldGroup.all.map { |fg| [fg.name, fg.id] } end |