Question: Alright so as I am learning this I have learned that electrons are arracted to the postive side.

So when I seen this photo it confused me why the resistor is on the postive terminal side. (When electricity flows from negative to postive [at least from what I read])

[![http://postimg.org/image/wujyef7hx/](https://i.stack.imgur.com/ONMNr.png)](https://i.stack.imgur.com/ONMNr.png)

So I've researched a lot and some people say batteries travel from postive to negative and others say they travel from negative to postive.

So here is my what I think:

The energy is flowing from the postive to negative: It limits it to the correct voltage to not damage the LED.

Or

The energy is flowing from the negative to postive and this example is showing the voltage pass through the LED then uses the resistor to eliminate the remaining voltage before it reaches the postive terminal. (Doesn't make sense to me much)

By the way can someone tell me how a resistor would prevent a battery from shorting out?

Answer: 
The electrons flow from negative to positive. Definition of current is the movement of the positives charges or "holes" (the move of an electron in one directions can be seen as the move of a hole in the opposite way).

About the resistor, in this case does not matter in wich side you put it. Its function is to limit the current.

**Observation:** Voltage DOESN'T flow!! ("the voltage pass through the LED then uses the resistor to eliminate the remaining voltage before it reaches the postive terminal")
A very basic law in electrical engineering is ohm law which says:

V = I \* R

V : is the voltage of the battery.

I : is the current that flow in the wires, the resistor, and the led.

R : is the total resistance of the circuit.

Let's calculate it first then understand why the resistor is at the positive terminal:

You are using 2 \* AA battery. Each AA battery has 1.5 volts. It means the total voltage is 3 volts because you are using two batteries. 

V = 3 volts

I assume that you use 100 ohm resistor.

The current that should flow in the circuit = 3 / 100 = 0.03 ampere

Now, The resistors control the current of the circuit and the amount of current should be 0.03 ampere. In Which direction?
The real electrons moves from the negative terminal to positive terminal. But that does **not** mean we should put the resistor at the negative terminal. Current pass or flow inside the wire and If you want to put something to interrupt it or make it slow down, you can put it in any place in series with the wire and it will interrupt the current. Think of a water pipe, If you want to slow the speed of water that pass through the pipe, you can put a rock (or something) inside the water pipe (No matter the place is) and the water will be interrupted.

If you are confused about the direction of flow of current: The real electrons moves from negative to positive. and We can imagine that there is positive charges movies from positive to negative, the imaginary positive charges move in the opposite direction of the negative charges. Now, I think it make sense. Why we imagine the direction of positive charges? because it is easier when you deal with complicated circuits and Circuits that have a lot of resistors, leds, capacitors and so on.

The answer of your second question "how a resistor would prevent a battery from shorting out?" is Ohms law. 
The voltage of the battery does NOT vary. and the led have low resistance. so the current will be very high. High currents generate heat quickly and may damage leds and other similar components.
Now we have to solutions, to decrease the voltage of the battery (it is impossible in many cases) and the other solution is to increase the resistance which what you have done.

The equation of ohm's law is described in the following picture in a funny way:
[![enter image description here](https://i.stack.imgur.com/s7eD5.gif)](https://i.stack.imgur.com/s7eD5.gif)