Rails 模型协会的困惑
我正在构建一个应用程序(用于学习 Rails),它允许公司/(个人)创建一个个人资料页面来列出他们的员工和技能,以便我网站的用户能够根据技能找到人员,以便他/她可以雇用他们作为合同工一段时间。
我有这些模型公司、员工、技能、合同,但我对如何在这些模型之间建立关联来完成我想要的事情感到困惑。
有没有类似的开源项目存在,以便我可以从中学习。
I am building a app(to learn rails) which allows companies/(individuals too) to create a profile page to list their employees and skills so a user to my site able to find people based on the skill so he/she can hire them as a contract employee for a period of time.
I have these models company,employee,skill,contract but i am confused about how to make associations between these models to do what i want.
Is there any open source projects similar to this exist so i can learn from it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来你需要:
然后你可以要求
@user.contracts
或@employee.skills
等。希望有帮助!
Sounds like you need:
Then you can ask for
@user.contracts
or@employee.skills
etc.Hope that helps!
我不确定有什么开源项目值得一看,但您是否已阅读过Rails 入门指南?它涵盖了基本的关联。
I'm not sure of any open source projects to look at but have you been through the Getting Started Rails Guide? It covers basic associations.