I have a JSON type in my model, which is coming from Postgres, the migration looks like:
create_table :people do |t|
t.string :name
t.json :links
end
This works:
permit_params :name, {:links => [:facebook, :twitter]}
form do |f|
f.inputs "Person Details" do
f.input :name
end
f.inputs :name => "Links", :for => :links do |g|
g.input :facebook, :input_html => { :value => "#{person.links['facebook']}" }
g.input :twitter, :input_html => { :value => "#{person.links['twitter']}" }
end
f.actions
end
It isn't the nicest solution, but unless someone has a better answer it will have to do.
There is a gem for that: https://github.com/udacity/activeadmin_json_editor
activeadmin_json_editor
lets you edit JSONb fields with a structured field editor. The admins should understand the concept of a hash or array but apart from that, it works out of the box.