Modified Static_Pages_Controller.rb

Reduced the code in static_pages_controller by moving common code into a
singular method. Hoping this works...