Sha256: 310701fb2e89e08759963e513e9bc300bf6482fb50f53fca3e05e843081f36cd

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

module ActiveAdmin
  module Views
    module Pages
      class New < Base

        def title
          I18n.t('active_admin.new_model', :model => active_admin_config.resource_name)
        end

        def main_content
          config = self.form_config.dup
          config.delete(:block)
          config.reverse_merge!({
            :url => collection_path,
            :as => active_admin_config.underscored_resource_name
          })

          if form_config[:partial]
            render(form_config[:partial])
          else
            active_admin_form_for(resource, config, &form_config[:block])
          end
        end
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
andrewroth_activeadmin-0.3.4 lib/active_admin/views/pages/new.rb
activeadmin-0.3.4 lib/active_admin/views/pages/new.rb
activeadmin-0.3.3 lib/active_admin/views/pages/new.rb
activeadmin-0.3.2 lib/active_admin/views/pages/new.rb
activeadmin-0.3.1 lib/active_admin/views/pages/new.rb
activeadmin-0.3.0 lib/active_admin/views/pages/new.rb
nsm-activeadmin-0.2.2 lib/active_admin/views/pages/new.rb