Fix Brakeman issues. Fix sql injection and javascript exploits.

Line is too long. [188/80]