简体   繁体   English

如何使用设计在 ruby​​ on rails 中创建辅助登录表单

[英]How to create a secondary login form in ruby on rails using devise

I'm relatively new to this.我对此比较陌生。 I am using devise with ruby and it generates its own sign in and sign up views.我正在使用带有 ruby​​ 的设计,它会生成自己的登录和注册视图。 I was wondering in addition to this, if I can create a secondary form that I can embed in my homepage that will let people sign in or sign up without having to redirect them to the devise's initial sign in and sign up page.除此之外,我想知道是否可以创建一个辅助表单,我可以将其嵌入到我的主页中,让人们登录或注册,而无需将他们重定向到设备的初始登录和注册页面。 If it's possible, how am I going to create session with the provided information in the homepage.如果可能,我将如何使用主页中提供的信息创建会话。

You should use devise command rails generate devise:views to generate devise views and than you can include app/views/devise/new I think its on this location ,partial to your homepage and also you will need to update css and some html to fit your homepage/place/position.你应该使用 devise command rails generate devise:views来生成设计视图,然后你可以包含 app/views/devise/new 我认为它在这个位置,部分到你的主页,你还需要更新 css 和一些 html 以适应您的主页/地点/位置。

Here you can find detailed info about custom sign in views with samples: https://github.com/plataformatec/devise/wiki/How-To:-Display-a-custom-sign_in-form-anywhere-in-your-app您可以在此处找到有关示例的自定义登录视图的详细信息: https : //github.com/plataformatec/devise/wiki/How-To : -Display-a- custom-sign_in-form-anywhere-in-your- app

Please check more info about devise views here: https://github.com/plataformatec/devise请在此处查看有关设计视图的更多信息: https : //github.com/plataformatec/devise

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM