Do you have any books to reccomend? I can't find any as good as Bass Guitar for Dummies is on guitar side.
If your goal is learning about writing a song in key and playing in key it's really hard to find a book that teaches scale and chord theory in a concise and efficient way without missing out massive pieces of information. A lot of them also teach in a really long and drawn out manner. I think your best bet is to use the internet and google "guitar chord theory".
Most of them like to talk note names (like C, E, G) which is very, very far from the most efficient way of learning chord theory on the guitar. Because you can move shapes up and down the neck on guitar it is more about intervals and shapes than note names. As said previously, if you know how to do a major barre chord at the third fret, you automatically know how to do a major barre chord in every fret - the only note you need to know is the root note (what I mean is you need to know that G occurs on the bottom string at the third fret if you want to play a G major chord). What the name of the other notes in the chord is doesn't really matter. So going on and on about note names in chords is not an efficient way to learn on guitar.
To get you started, here's a major scale on the guitar starting on the bottom string. The notes have been labelled 1 through 7 which is important for the next step of constructing a chord.

Once you know this shape, you can play the major scale in every key by just moving the shape up and down the neck. If you start with the "1" on the third fret, bottom string, you'll play a G major scale.
Chords are constructed by playing certain notes from the scale at once. A major chord consists of the 1st, 3rd and 5th note of the scale, played together. A minor chord is the same as a major, except you play a flat 3rd. So you play the first and fifth notes of the major scale, but you move the third note back one fret.
This page will help you further:
http://www.fretjam.com/guitar-chord-theory.htmlIt's not a bad page, but misses out the first step I just outlined which is fairly crucial. If you look at their image of a major chord, you will see how the notes line up with the major scale above:

Notice how a minor chord is the same, but flattens the 3rd:

This might get you started in the right direction if it's what you are after. Learning how you come up with the chords in a certain key is the next step, but you have to get this stuff down before you move onto that. But once you learn it, you'll be able to write songs in any key, and improvise over those chords in key (whether your notes sound any good is another matter and requires practice, but you have to know where the right notes are to begin with).
The other nice thing about understanding this stuff is that you can play any chord you want once you can read chord names (which isn't hard). It might take you a minute to figure out but if a song has an Am7add13 you could do it without referring to a book or anything. If you are a professional session player, of course you know zillions of chord shapes already, but for bedroom playing you don't need to memorise zillions of chord shapes, you just have to know how to make them (or you need a big-ass chord shape book and refer to it all the time).