Wikipedia - 

Evolution to the general ticket

Alexander Hamilton described the framers' view of how electors would be chosen, "A small number of persons, selected by their fellow-citizens from the general mass, will be most likely to possess the information and discernment requisite to such complicated [tasks]."[29] The founders assumed this would take place district by district. That plan was carried out by many states until the 1880s. For example, in Massachusetts in 1820, the rule stated "the people shall vote by ballot, on which shall be designated who is voted for as an Elector for the district."[30] In other words, the people did not place the name of a candidate for a president on the ballot, instead they voted for their local elector, whom they trusted later to cast a responsible vote for president.