Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/11/2013, 19:37
Avatar de kalvinman
kalvinman
 
Fecha de Ingreso: octubre-2006
Ubicación: Bogota Colombia
Mensajes: 849
Antigüedad: 17 años, 6 meses
Puntos: 22
Respuesta: Error al validar si un email ya existe find_by

Me respondo a mi mismo, mi solución fue:

Código ruby:
Ver original
  1. if User.find(:all, :conditions => {:user => post_params[:user]}).count > 0
  2.       redirect_to action: :home
  3.     else
  4. private
  5.     def post_params
  6.       params.require(:user).permit(:user, :password, :email, :college, :firstname, :lastname, :birthdate, :iddocument, :document_type, :city)
  7.     end