简体   繁体   中英

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. 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.

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

Please check more info about devise views here: https://github.com/plataformatec/devise

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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