Rails嵌套复杂表单

时间:2017-09-05 09:53:49

标签: ruby-on-rails forms nested

我正在寻找建立cacsade表格的好主意。

我正在寻找的是构建一个表单来构建一个配置yml数据。

例如,构建键值表单,值字段可以是字符串或散列或数组。

config - >项目 - >有关键和价值 - >可以是String,Array或Hash。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我所做的是使用3djs生成一个graphe并使editabe成为一个节点并处理添加/删除节点。我分享你为我做的事情,想要做同样的事情......(flare.json是回复json文件的行动)

func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {

    // here, you should edit "0" to be matched with your selected item
    // for instance, if there is 5 items and the desired item is in the middle, the compared value should be "2"
    if tabBarController.selectedIndex == 0 {

        // simply, you will need to get the desired view controller and persent it:
        let desiredStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let desiredViewController = desiredStoryboard.instantiateViewController(withIdentifier: "storyboard id")

        present(desiredViewController, animated: true, completion: nil)

    }
}