title: Errors does not show/ Rails, simple_form
body: <p>I want to show errors when they are in form and can not understand why this code does not work.
  <strong>hotel.rb</strong></p>
  
  <pre><code>class Hotel &lt; ActiveRecord::Base
  ...
    has_many :comments
  ...
  end
  </code></pre>
  
  <p><strong>comment.rb</strong></p>
  
  <pre><code>class Comment &lt; ActiveRecord::Base
    belongs_to :hotel
    belongs_to :user
    delegate :email, to: :user, prefix: true
  
    validates :body, presence: true, length: { minimum: 5, maximum:200 }
  end
  </code></pre>
  
  <p><strong>hotels/show.</strong></p>
  
  <pre><code>...
      %h2 Comments
      #comments
        .ui.piled.blue.segment
          .ui.header
            %i.icon.inverted.circular.blue.comment
            Comments
          .ui.comments
            = render :partial =&gt; @hotel.comments
          = render 'comments/form', comment: @hotel.comments
  ...
  </code></pre>
  
  <p><strong>_form</strong></p>
  
  <pre><code>-if user_signed_in?
    = simple_form_for [@hotel, Comment.new] do |f|
      =f.error_notification
      %br
      .ui.reply.form
        .field
          =f.label :body, "New comment"
          =f.input :body, as: :text, label: false
          =f.submit 'Add comment', class: "ui fluid blue labeled submit icon button"
  -else
    =link_to 'Sign in to add comment', new_user_session_path, class: 'ui blue button'
  </code></pre>
  
  <p><strong>_comment</strong></p>
  
  <pre><code>= div_for comment do
    .comment
      .content
        %span.author= comment.user_email
        .metadata
          %span.date Posted #{time_ago_in_words(comment.created_at)} ago
      .text
        = comment.body
  </code></pre>
  
  <p>If you add too_short and too_long model that does not correct the.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>comments_controller</strong></p>
  
  <pre><code>class CommentsController &lt; ApplicationController
    def create
      @hotel = Hotel.find(params[:hotel_id])
      @comment = @hotel.comments.new(comment_params)
      @comment.user_id = current_user.id
      @comment.save
      redirect_to @hotel
  end
  
  private
    def comment_params
      params.require(:comment).permit(:user_id, :body, :hotel_id)
    end
  end
  </code></pre>