Rendering joined array to display Rails Errors
===

Having a bit of an issue rending rails errors. The main issue is that on the view the errors  display an array output and not joined together (user friendly).  I can add the "join" method in the view and that will work fine on attributes with multi errors.  Although naturally if the attribute only contains 1 error this will break.

So I'm currently attempting to have the errors join in the controller so that if there multi errors on an attribute it will look pretty.  Trying to add the .join method in the view is not working because on the instances where there is 1 error it will break (since you can't invoke the join method on a string)

any help how to make this work in the controller would be great.   Any suggestions on another way of handling this issue is also great.   (from my logic of trying to prettyify/join the array errors in the controller like this)


Controller:

    if @person.errors.blank? && @person.save
      flash[:info] = "Your profile has been successfully updated."
      redirect_to profile_url(@person) and return
    else
      if @person.errors.on(:first_name).is_a?(Array)
        @person.errors.on(:first_name).join
      end
      flash[:warning] = "Sorry, there was a problem saving your profile. Please try again."
      render :edit
    end


View:  

    %li
            = label(:person, :first_name, "First Name")
            = f.text_field :first_name
            - if @person.errors[:first_name].present?
              %span{:style => "color: red; margin-left: 180px;"}=   @person.errors[:first_name]