activeadmin: Unable to find input class for hstore

I have hstore as one of the data types for my backend and it seems like formtastic hasn’t supported this data type yet. Help 😦?

This is the error that I got: Unable to find input class for hstore

About this issue

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

Most upvoted comments

Quick’n’dirty fix for this is to create a Formtastic input in app/inputs/hstore_input.rb:

class HstoreInput < Formtastic::Inputs::TextInput
end

@McFin, here is the rb file:

ActiveAdmin.register Provider do
  permit_params :dob, :current_address
  menu parent: 'User'
  config.sort_order = 'id_asc'
  actions :all, except: [:new]
  filter :mobile_number
  filter :id

  index do
    selectable_column
    column :id
    column :mobile_number
    column :name
    column :gender
    column :dob
    column :current_address
    actions
  end

  form do |f|
    f.inputs 'Provider Details' do
    f.input :dob, as: :datepicker
      f.fields_for :current_address do |current_address|
        current_address.input :full_address,
                              input_html: {value: f.object.current_address.
                                                  try(:[], 'full_address')}
      end
    end
    f.actions
  end
end

Here is the stackoverflow question I created for it: http://stackoverflow.com/questions/35218336/active-admin-form-with-hstore-column-unpermitted-param-error