Rails的协会帮助 [英] Rails association help

查看:154
本文介绍了Rails的协会帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我做了一个名为图片支架,但现在我需要它有许多标签。
我希望它是这样,你可以做,然后像点击添加标签在标签填写,然后点击添加标签...,这将是在图片/新和编辑,或许显示。
我没有线索如何做到这一点,我不是在轨很大,所以如果你可以很清晰。 (也许有一些像一个按钮,如果你点击它,你执行一个功能滑轨,即使在当时我不知道如何去这个)
我使用的铁轨3。

Hey I made a scaffold called pictures, but now I need to it to have many tags. I want it to be so that you can do something like click add tag then fill in a tag, then click add tag ..., this would be in pictures/new and edit, and maybe show. I don't have a clue how to do this and I am not that great in rails, so be very clear if you can. (maybe there is something in rails like a button that if you click it you execute a function, even then I'm not sure how to go about this) I am using rails 3.

推荐答案

这是你需要的东西:


  1. http://railscasts.com/episodes/196 -nested模型外形部分-1

http://railscasts.com/episodes/197 -nested模型外形部分2

这篇关于Rails的协会帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆