2011-11-06 49 views
1

如何控制活动管理员编辑页中字段的显示顺序?要自定义视图页,我已经更新了管理/模型文件:控制活动管理员编辑页上字段的顺序

ActiveAdmin.register Church do 
    menu :priority => 2 
    scope :inactive 
    scope :unregistered 
    scope :active 
    scope :registered 

    show do 
    attributes_table :name, :address1, :address2, :city, :state, :zip, :office_phone, 
       :fax, :email1, :active, :registered 
    end 

但是,改变“秀”到“编辑”或“新”的结果无方法错误。

回答

4

只需更改attributes_table中的项目顺序,ActiveAdmin将使用该顺序显示。

更新:在编辑页面...

form do |f| 
    f.inputs "Label" do 
    f.input :name 
    f.input :address1 
    # etc 
    end 
end 
+0

Sorens - 谢谢你的回复。我仍然在这里错过了一些东西。通过上面的代码,'show'表单确实按照与'attributes_table'中相同的顺序显示字段。然而,“编辑”表单以不同的顺序显示它们。 – Rick

+0

@rick道歉,我错过了你在问“编辑”页面。你需要改变'form do | f |结束'你可以按照你想要的顺序放入'f.input'。 – sorens

+0

索伦森,是的,就是这样。再次感谢你的帮助。 – Rick

相关问题