Update weighting.rb

fix nil error after updating weightings in web browser