Skip to content
This repository was archived by the owner on Mar 19, 2022. It is now read-only.

Repository files navigation

ActiveAdmin SimpleForm Gem Version

WARNING: this component is just a proof of concept, it can be useful for experimental purposes.


An Active Admin plugin to use Simple Form in place of Formtastic in edit views.

Install

  • Add to your Gemfile: gem 'activeadmin_simple_form'
  • Execute bundle
  • Create the Simple Form config initializer: rails generate simple_form:install
  • Add to the config the wrapper used for the fields in inputs blocks:
config.wrappers:inputs_container,tag: :li,class: :input,hint_class: :field_with_hint,error_class: :field_with_errorsdo |b|
b.use:html5b.use:placeholderb.optional:maxlengthb.optional:minlengthb.optional:patternb.optional:min_maxb.optional:readonlyb.use:label_inputb.use:hint,wrap_with: {tag: :span,class: :hint}b.use:error,wrap_with: {tag: :span,class: :error}end

Example

  • Author model example:
formdo |f|
f.inputs'Informations'dof.input:namef.input:agef.association:country# using input for associations is not supportedf.has_many:articlesdo |ff|
ff.input:titleff.input:descriptionff.input:publishedff.input:_destroy,as: :boolean,required: falseunlessff.object.new_record?endendf.actionsend

Do you like it? Star it!

If you use this component just star it. A developer is more motivated to improve a project when there is some interest.

Take a look at other ActiveAdmin components that I made if you are curious.

Contributors

License

MIT

About

An ActiveAdmin 1.x plugin to use Simple Form in place of Formtastic in edit views

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages