ruby on rails - Error message in partial rendered twice -
I was practicing with the ROR tutorial, and there is a strange problem where error message was provided twice.
In this code (line 7) I am providing a partial any ideas? > Edit: Added partial I think you have a syntax error = If @ user.errors.any? Partial to - If @ user.errors.any? new.html.slim
- Provide (title, 'sign up') h1 sign div class = " Row "div class =" col-sm-6 col-sm-offset-3 "= form_for (@ user, html: {role:" form "}) do | F | = 'Shared / error_message' div class = "form-group" = f.label: name = f.text_field: name, class: "form-control" div class = "form-group" = f.label: email = F.text_field: email, class: "form-control" div class = "form-group" = f.label: password = f.password_field: password, category: "form-control" div class = "form-group" = F.label: password_confirmation, "confirmation" = f.password_field: password_confirmation, category: "form-control" = f.submit "create account", category: "btn btn-LG btn-primary"
shared / error_ message The I page is being called in this way:
User S_controller.rb
def create user @user.net (user_update) if user @
= If @ User.errors.any? Div # error_explanation div class = "alert alert-danger" | Form = "#{@user.errors.count}". Error (s) ul - @user.ros.ful__ messages.each do | Msg | | Li = "# {msg}"
Comments
Post a Comment