如何使用Bootstrap for Rails获取登录链接以在注册按钮下面进行渲染 [英] How can I get the Sign in link to render below the Sign up Button using Bootstrap for Rails

查看:413
本文介绍了如何使用Bootstrap for Rails获取登录链接以在注册按钮下面进行渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个使用Rails的新编码器。我正在使用Bootstrap配置Devise注册页面。



根据图像。 在此输入图片说明



我可以做些什么来让我的代码让登录链接重新定位到注册按钮下面,使其外观更美观。

 < div class =col-md-4> 
< h2>注册< / h2>

< form class =form-signup
< div class =form-group>
< label for =email>电子邮件< / label>
< input type =email class =form-control>
< / div>
< div class =form-group>
< label for =password> / label>
< input type =passwordclass =form-control>
< / div>
< div class =form-group>
< label for =passwordconfirm>密码确认< / label>
< input type =passwordclass =form-control>
< / div>
< button class =btn btn-danger btn-blocktype =submit>注册& LT; /按钮>
< / form>
< / div>
<%end%>


<%= renderdevise / shared / links%>
< / div>


解决方案

如果你把SignUp放在里面,行。

 < div class =form-group> 
< button class =btn btn-danger btn-blocktype =submit>登录< / button>< / div>

看看@代码: https://jsfiddle.net/DTcHh/13646/embedded/result/


I am a new coder using Rails. I am configuring the Devise signup page using Bootstrap.

As per the image. enter image description here

What can I do to my code to get the "Sign in" link relocated to sit below the "Sign Up' Button to make it look aesthetically better.

<div class="col-md-4">
<h2>Signup</h2>

 <form class="form-signup">
  <div class="form-group">
    <label for="email">Email</label>
    <input type="email" class="form-control">
  </div>
  <div class="form-group">
    <label for="password">Password</label>
    <input type="password" class="form-control">
  </div>
  <div class="form-group">
    <label for="passwordconfirm">Password confirmation</label>
    <input type="password" class="form-control">
  </div>
  <button class="btn btn-danger btn-block" type="submit">SignUp</button>
</form>
</div>
<% end %>


<%= render "devise/shared/links" %>
</div>

解决方案

If you put the SignUp inside it will be in new row.

<div class="form-group">
      <button class="btn btn-danger btn-block" type="submit">Sign in</button></div>

Have a look @ the code: https://jsfiddle.net/DTcHh/13646/embedded/result/

这篇关于如何使用Bootstrap for Rails获取登录链接以在注册按钮下面进行渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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