def create
      @family = Family.new
      [:father, :mother].each do |p|
        pp = params[p].keep_if { |k,v| !v.blank? }

        @family.__send__ "#{p}=", (pp.blank? ? nil : get_user_from_params(pp))
      end

      respond_to do |format|
        if @family.save
          uninitialized_pw = User.initialize_without_password("").password_digest
          [@family.father, @family.mother].select { |p| p }.each { |p|
            user_is_new = p.user.password_digest == uninitialized_pw
            EasyRailsAuthentication::AuthenticationHelper.SendPasswordInitializationEmailTo p.email if user_is_new
          }
          format.html { redirect_to (added_user_info? ? family_url(@family.id) : families_url), notice: 'Family was successfully created.' }
          format.json { render json: @family, status: :created, location: @family }
        else
          format.html { render action: "new" }
          format.json { render json: @family.errors, status: :unprocessable_entity }
        end
      end
    end
def create
      @family = Family.new
      [:father, :mother].each do |p|
        pp = params[p].keep_if { |k,v| !v.blank? }

        @family.__send__ "#{p}=", (pp.blank? ? nil : get_user_from_params(pp))
      end

      respond_to do |format|
        if @family.save
          uninitialized_pw = User.initialize_without_password("").password_digest
          [@family.father, @family.mother].select { |p| p }.each { |p|
            user_is_new = p.user.password_digest == uninitialized_pw
            EasyRailsAuthentication::AuthenticationHelper.SendPasswordInitializationEmailTo p.email if user_is_new
          }
          format.html { redirect_to (added_user_info? ? family_url(@family.id) : families_url), notice: 'Family was successfully created.' }
          format.json { render json: @family, status: :created, location: @family }
        else
          format.html { render action: "new" }
          format.json { render json: @family.errors, status: :unprocessable_entity }
        end
      end
    end
POST /families
 POST /families.json