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

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

问题描述

你好我已经是rails,我已经安装了rails 4.我想知道我正在为老师n学生制作项目。我可以把设计宝石应用于老师和学生的模范。我的项目主要是教师和学生签署的形式需要不同。那么任何人都可以告诉我如何应用设计的程序,以便可以不同地创建注册表单。

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可以为您工作,但您必须运行一些教程。对于堆栈溢出问题,您对完整操作方法的请求过于宽泛。 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天全站免登陆