Rails Active Admin only displays the last field when I create my form. Resolution settings not accepted: page margin
I have 2 problems.
1) formtastic will only show the last input field, not all of them. In this case, it will only display:
r.input :sort_order
2) I had to do some wierd wrap f.inputs around each field to get it to appear, which I think is wrong. But when I submit the form, it says "Non-Pass Parameters: Page". When I have clearly defined the page, I don't know how else to get the access parameters to accept this.
Here is my model
class Fact < ActiveRecord::Base
has_one :page, as: :pageable, dependent: :destroy
accepts_nested_attributes_for :page
end
Another model:
class Page < ActiveRecord::Base
belongs_to :pageable, polymorphic: true
end
My active admin:
ActiveAdmin.register Fact do
permit_params :id, page_attributes: [:type, :name, :description :sort_order ]
form do |f|
f.inputs "My Page", for: [:page, f.object.page || Page.new] do |r|
r.input :name
r.input :description
r.input :sort_order
end
end
end
+3
source to share
No one has answered this question yet
Check out similar questions: