Rendering devise error messages in scoped custom form

前端 未结 1 1656
终归单人心
终归单人心 2021-01-24 04:49

I have to Devise models, User and Vendor. I generated the views for Vendor and customized the signup form to suit my needs. I needed to tweak the regis

相关标签:
1条回答
  • 2021-01-24 05:27

    I would write this as a comment, but it will be easier to read as an answer:

    Perhaps you could try replacing devise_error_messages! with a standard Rails error display:

    <% if resource.errors.any? %>
        <div class="error">
            <strong><%= pluralize(resource.errors.count, "Error") %></strong>
            <ul>
                <% resource.errors.each do |attr,msg| %>
                    <li><%= msg %></li>
                <% end %>
            </ul>
        </div>
    <% end %>
    
    0 讨论(0)
提交回复
热议问题