在 rails 应用程序中为多个模型使用设计 [英] Using devise for more than one models in rails app

查看:17
本文介绍了在 rails 应用程序中为多个模型使用设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是 rails 新手,我已经安装了 Rails 版本 4.我想知道我正在为 n 老师的学生制作项目.我可以将设计 gem 应用于模型教师和学生吗?在我的项目中,最主要的是教师和学生的报名表都需要不同.那么谁能告诉我如何申请设计以便可以创建不同的注册表单的程序...

hello I am new to rails and i have installed rails version 4. I would like to know that I am making project for teacher n students. Can I apply devise gem to both the models teachers and students. The main thing in my project is that both teachers and students sign up form need to be different. Then can anyone tell me the procedure of how to apply devise such that sign up forms can be created differently...

推荐答案

Devise 可以为您工作,但您必须完成一些教程.您对完整操作方法的要求对于 Stack Overflow 问题来说过于宽泛.http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html#authorization

Devise can work for you, but you will have to run through some tutorials. Your request for a complete how-to is too broad for an Stack Overflow question. http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html#authorization

您可能还想查看 gem 来管理权限,因为 Devise 更多用于身份验证.我个人最喜欢的是the_role,但其他人喜欢cancan 非常喜欢.

You may also want to look at a gem to manage permissions, as Devise is more for authentication. My personal favorite is the_role, but others like cancan very much.

这篇关于在 rails 应用程序中为多个模型使用设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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