Method: CmsHelper#dc_tab_label_help

Defined in:
app/helpers/cms_helper.rb

#dc_tab_label_help(tab_name) ⇒ Object

Return label and help for tab on Form.

Parameters: options : String : Tab name on form

Returns:

label : String : Label text
help : String : Help text


149
150
151
152
153
154
155
156
157
158
# File 'app/helpers/cms_helper.rb', line 149

def dc_tab_label_help(tab_name)
  label = @form.dig('form', 'tabs', tab_name, 'caption') || tab_name
  label = t(label, t_label_for_field(label, label))

  help = @form.dig('form', 'tabs', tab_name, 'help') || "helpers.help.#{@form['table']}.#{tab_name}"
  help = t(help, t_label_for_field(help, help))
  help = nil if help.match('helpers.') # help not found in translation

  [label, help]
end