I find all the above answers to be quite good, but each is too busy for my tastes ... too many pieces, specialty hardware etc ...
My solution would be to ...
- locate the studs
- drive 2.5" nails into the studs such that
- they angle upwards
- have 1" exposed
- I'd use either of these 8d or 10d nails:
- box nails, and a pair of vise-grips or slip-joints to cut off the heads after nailing
- finish or casing nails, and not cut off anything
- then drill matching 1/4" holes into the back of the 2x4s.
Done. No need to shop for specialty hardware, or run to the store, or go through router setups and associated issues. Plus, requires only one hole in the sheetrock per attachment as opposed to 2 or more.
BOX NAILS
Penny Length Gauge Diameter
inches inches
2d 1 15½ 0.067
3d 1¼ 14½ 0.076
4d 1½ 14 0.080
5d 1¾ 14 0.080
6d 2 12½ 0.099
7d 2¼ 12½ 0.099
8d 2½ 11½ 0.113
9d 2¾ 11½ 0.113
10d 3 10½ 0.128
12d 3¼ 10½ 0.128
16d 3½ 10 0.135
20d 4 9 0.148
30d 4½ 9 0.148
40d 5 8 0.162