activeadmin: active admin doesn't work with simple form

wrong number of arguments (6 for 4..5)
Extracted source (around line #1):
1

  insert_tag renderer_for(:new)

simple_form (3.0.0) lib/simple_form/inputs/base.rb:50:in `initialize'
formtastic (2.3.0.rc2) lib/formtastic/helpers/input_helper.rb:241:in `new'
formtastic (2.3.0.rc2) lib/formtastic/helpers/input_helper.rb:241:in `input'
/Users/sashazykov/.rvm/gems/ruby-2.0.0-p247/bundler/gems/active_admin-7ad6ec39d959/lib/active_admin/form_builder.rb:26:in `block in input'
/Users/sashazykov/.rvm/gems/ruby-2.0.0-p247/bundler/gems/active_admin-7ad6ec39d959/lib/active_admin/form_builder.rb:134:in `with_new_form_buffer'
/Users/sashazykov/.rvm/gems/ruby-2.0.0-p247/bundler/gems/active_admin-7ad6ec39d959/lib/active_admin/form_builder.rb:26:in `input'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:329:in `block in fieldset_contents_from_column_list'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:317:in `collect'`

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 36 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@SpecialCyCi there is actually an issue with my previous solution, because it overwrites the existing input_html_classes method instead of adding to it. While I don’t know whether this would be a problem in practice, the better way to do it is this:

inputs.each do |input_type|
  "SimpleForm::Inputs::#{input_type}".constantize.class_eval do
    alias_method :__input_html_classes, :input_html_classes
    define_method(:input_html_classes) do
      __input_html_classes.push('form-control')
    end
  end
end