Sha256: a0bf06a9c8326a5be210303c51eb723bf19d73da77acedea321e2e09fe0d035e

Contents?: true

Size: 841 Bytes

Versions: 15

Compression:

Stored size: 841 Bytes

Contents

module ActiveAdminAddons
  module InputHtmlHelpers
    include InputMethods

    def prefixed_method
      "#{model_name}_#{valid_method}"
    end

    def method_to_input_name
      "#{model_name}[#{valid_method}]"
    end

    def method_to_input_array_name
      "#{method_to_input_name}[]"
    end

    def method_to_input_id(id)
      raise "invalid input id" if id.blank?
      "#{prefixed_method}_#{id}"
    end

    def selected_values_id
      "#{prefixed_method}_selected_values"
    end

    def empty_input_id
      "#{prefixed_method}_empty"
    end

    def build_separator
      template.content_tag(:span, "-", class: "separator")
    end

    def build_hidden_control(id, name, value = nil)
      builder.hidden_field(
        valid_method,
        id: id,
        name: name,
        value: value
      )
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
activeadmin_addons-1.8.3 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.8.2 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons_rails6-1.7.2 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.7.1 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.7.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.6.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.5.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.4.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.3.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.2.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.1.2 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.1.1 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.1.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.0.1 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb
activeadmin_addons-1.0.0 lib/activeadmin_addons/support/input_helpers/input_html_helpers.rb