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.

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"   

In this code (line 7) I am providing a partial 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 @   

any ideas?

>

Edit: Added partial

  = 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}"    

I think you have a syntax error

= If @ user.errors.any?

Partial to

- If @ user.errors.any?

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -