示例JSON数据:
@ingredient.update_attributes(quantity: (@ingredient.quantity + @delivery.delivered))
HTML
[{"series":"Naruto","chapter":"300","path":"mangas\/Naruto\/300\/01.jpg"},
{"series":"Naruto","chapter":"300","path":"mangas\/Naruto\/300\/02.jpg"},
{"series":"Naruto","chapter":"300","path":"mangas\/Naruto\/300\/03.jpg"},
{"series":"Naruto","chapter":"301","path":"mangas\/Naruto\/301\/01.jpg"},
{"series":"Naruto","chapter":"301","path":"mangas\/Naruto\/301\/02.jpg"},
{"series":"Naruto","chapter":"301","path":"mangas\/Naruto\/301\/03.jpg"},
{"series":"One Piece","chapter":"788","path":"mangas\/One%20Piece\/0788\/00.jpg"},
{"series":"One Piece","chapter":"788","path":"mangas\/One%20Piece\/0788\/01.jpg"},
{"series":"One Piece","chapter":"788","path":"mangas\/One%20Piece\/0788\/02.jpg"}
{"series":"One Piece","chapter":"789","path":"mangas\/One%20Piece\/0789\/00.jpg"},
{"series":"One Piece","chapter":"789","path":"mangas\/One%20Piece\/0789\/01.jpg"},
{"series":"One Piece","chapter":"789","path":"mangas\/One%20Piece\/0789\/02.jpg"}]
我想绑定这些选择菜单。首选菜单属于系列。第二个选择菜单属于章节,第三个属于页面。当您将第一个选择菜单“火影忍者”更改为“海贼王”时,它会加载“海贼王”章节和“最后一件”章节。我怎样才能做到这一点?
答案 0 :(得分:1)
根据你的json数据模式,我认为你不能用你想做的事情取得好成绩。首先是因为json中有一些不必要的数据,其次是因为你应该使用这个json并用额外的代码数据解析它。我认为你可以看到每个元素和复合对象,从系列名称开始,在这个章节列表中以及每个章节里面的页面或图像。使用数据时的想法是获得良好的响应时间。希望这能帮助你。