1

我有关系 ContentRelease has_many pages。以下 activeadmin 注册模型允许我在 content_release 中编辑页面的属性,但不能为内容发布创建新页面。没有错误,我收到一条成功消息,但没有保存新页面。我究竟做错了什么?

ActiveAdmin.register ContentRelease do

  form do |f|
    f.actions

    f.inputs "Details" do
      f.input :active_at
    end

    f.inputs "Pages", :class => 'pages-list' do
      f.has_many :pages do |page|

        page.inputs "Associated Look" do
          page.input :title
          page.input :content_release, :as => :select, :collection => ContentRelease.list
          page.input :look, :as => :select, :collection => Look.current
          page.input :share_url
        end

      end
    end

    f.inputs "Looks", :class => 'looks-list' do
      f.has_many :looks do |look|
        look.inputs do
          look.input :title
        end
      end
    end

    f.actions


  end
4

0 回答 0