RailsAdmin: hstore columns don't show

When you try to create, view or edit an entry in RailsAdmin columns hstore not displayed. I assume that RailsAdmin does not support this Postgres data type, although it is supported in Rails 4.

Is there a workaround?

+4
source share
1 answer

The easiest way I added hstore fields to the Rails Admin is to use Rails 4 store_accessorin the model and specify the fields in the Rails admin configuration for the model.

class Organization < ActiveRecord::Base
  store_accessor :modules, :internal, :external, :default => 'no'

  rails_admin do
    Organization.stored_attributes[:modules].each do |field|
      configure field
    end
  end
end

I made the full demo version available on Github.

, hstore, Rails Admin .

+5

All Articles