Sha256: 9f2dd90e82e21cdfa1374252e88e174ec12bddfc63359b4b29da23cc5746afa6

Contents?: true

Size: 762 Bytes

Versions: 9

Compression:

Stored size: 762 Bytes

Contents

module ActiveAdmin
  class ResourceController < ::InheritedResources::Base
    module Form
      extend ActiveSupport::Concern

      included do
        helper_method :form_config
      end

      module ClassMethods

        def form_config=(config)
          @form_config = config
        end

        def form_config
          @form_config ||= default_form_config
        end

        def reset_form_config!
          @form_config = nil
        end

        def default_form_config
          config = {}
          config[:block] = lambda do |f|
            f.inputs
            f.buttons
          end
          config
        end
      end

      protected

      def form_config
        @form_config ||= self.class.form_config
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
andrewroth_activeadmin-0.3.4 lib/active_admin/resource_controller/form.rb
activeadmin-0.3.4 lib/active_admin/resource_controller/form.rb
activeadmin-0.3.3 lib/active_admin/resource_controller/form.rb
activeadmin-0.3.2 lib/active_admin/resource_controller/form.rb
activeadmin-0.3.1 lib/active_admin/resource_controller/form.rb
activeadmin-0.3.0 lib/active_admin/resource_controller/form.rb
nsm-activeadmin-0.2.2 lib/active_admin/resource_controller/form.rb
saulolso-activeadmin-0.2.2.1 lib/active_admin/resource_controller/form.rb
saulolso-activeadmin-0.2.2 lib/active_admin/resource_controller/form.rb