【问题标题】:Can two modals be used to authenticate a devise user in Rails 6?在 Rails 6 中可以使用两种模式来验证设计用户吗?
【发布时间】:2021-07-19 16:51:30
【问题描述】:

我有一个 Rails 6 应用程序,其中包括用于身份验证的设计和简单表单。我的目标是使用两种模式对用户进行身份验证。电子邮件将在一个模式中进行验证,如果电子邮件存在,它将链接到另一个验证密码的模式。例如,Google gmail 使用这种登录策略。

我试图创建一个按照本教程设计的单一模式Hack your Rails 5 Signup Form with Ajax,让用户在单一引导模式中登录。

<!-- Modal -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      
      <div class="modal-body">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      
        <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), remote: true, :html => {:class => 'form-horizontal' }) do |f| %>
          <div class="form-inputs">
            <div class="errors"></div>
            <%= f.input :email,
                        required: true,
                        autofocus: true,
                        input_html: { class: "inputStyling" } %>

            <%= f.input :password,
                        required: true,
                        input_html: { class: "inputStyling" } %>
            
          </div>
          <div class="form-actions">
            <%= f.button :submit, "Continue", :class => "create", %>
          </div>
        <% end %>
      </div>
      <div class="modal-footer">
<!--- Add omni authentication -->
      </div>
    </div>
  </div>
</div>

编辑 我想澄清我的问题。我正在努力设计身份验证。如何在一个模式中验证用户的电子邮件,然后链接到另一个模式以进行密码验证?

【问题讨论】:

  • 欢迎来到 StackOverflow。你的问题到底是什么,你具体在努力解决什么问题?
  • 我正在努力设计身份验证。如何在一个模式中验证用户的电子邮件,然后链接到另一个模式以进行密码验证?这可能吗?

标签: javascript ruby-on-rails ruby devise


【解决方案1】:

我想我可以使用表单向导来完成我想做的事情。我会研究一下 wicked gem,它是一个向导插件。

【讨论】:

    猜你喜欢
    • 2016-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-29
    • 2016-10-10
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    相关资源
    最近更新 更多