app/helpers/edgarj/assoc_helper.rb in edgarj-0.01.30 vs app/helpers/edgarj/assoc_helper.rb in edgarj-0.02.00
- old
+ new
@@ -175,15 +175,19 @@
# f:: FormBuilder object
# col_name:: 'belongs_to' column name
# popup_field:: Edgarj::PopupHelper::PopupField object
# parent_name:: initial parent name
def draw_belongs_to_clear_link(f, col_name, popup_field, parent_name, default_label)
- (' ' +
- link_to("[#{I18n.t('edgarj.default.clear')}]", '#',
- onClick: "Edgarj.Popup.clear('#{j(popup_field.id_target)}','#{j(default_label)}'); return false;",
- id: popup_field.clear_link,
- style: 'display:' + (parent_name.blank? ? 'none' : '')) +
- f.hidden_field(col_name)).html_safe
+ if Settings.edgarj.belongs_to.disable_clear_link
+ f.hidden_field(col_name)
+ else
+ (' ' +
+ link_to("[#{I18n.t('edgarj.default.clear')}]", '#',
+ onClick: "Edgarj.Popup.clear('#{j(popup_field.id_target)}','#{j(default_label)}'); return false;",
+ id: popup_field.clear_link,
+ style: 'display:' + (parent_name.blank? ? 'none' : '')) +
+ f.hidden_field(col_name)).html_safe
+ end
end
# draw 'belongs_to' popup data-entry field
#
# This is usually used with draw_belongs_to_label().