Module: Alchemy::Admin::ElementsHelper

Includes:
IngredientsHelper
Defined in:
app/helpers/alchemy/admin/elements_helper.rb

Instance Method Summary collapse

Methods included from IngredientsHelper

#ingredient_label, #render_ingredient_role

Methods included from BaseHelper

#alchemy_body_class, #alchemy_datepicker, #button_with_confirm, #clipboard_select_tag_options, #current_alchemy_user_name, #delete_button, #hint_with_tooltip, #js_filter_field, #link_to_confirm_dialog, #link_to_dialog, #link_url_regexp, #page_layout_missing_warning, #render_alchemy_title, #render_hint_for, #sites_for_select, #toolbar_button, #translations_for_select

Methods included from NavigationHelper

#alchemy_main_navigation_entry, #entry_active?, #main_navigation_css_classes, #navigate_module, #sorted_alchemy_modules, #url_for_module, #url_for_module_sub_navigation

Methods included from BaseHelper

#page_or_find, #render_icon, #render_message, #shorten, #warning

Instance Method Details

#elements_for_select(elements) ⇒ Array

Returns an elements array for select helper.

Parameters:

  • elements (Array)

    definitions

Returns:

  • (Array)


13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/alchemy/admin/elements_helper.rb', line 13

def elements_for_select(elements)
  return [] if elements.nil?

  elements.collect do |e|
    [
      Element.display_name_for(e["name"]),
      e["name"]
    ]
  end.sort
end