def errors_for(model, attribute)
      if model.errors[attribute].present?
        name = model.class.name.constantize.human_attribute_name(attribute)
        content_tag :span, :class => 'help-block error' do
          name.to_s.capitalize + ' ' + model.errors[attribute].join(", ")
        end
      end
    end
def errors_for(model, attribute)
      if model.errors[attribute].present?
        name = model.class.name.constantize.human_attribute_name(attribute)
        content_tag :span, :class => 'help-block error' do
          name.to_s.capitalize + ' ' + model.errors[attribute].join(", ")
        end
      end
    end
display errors inline to the input
 Params:
 +model+:: ActiveRecord model from form
 +attribute+:: the attribute that you want to check errors for