title: axios PUT request to rails-API
body: <p>I'm trying to post a new score instance to my rails-API but whenever I submit it the app resets itself without updating the state - the console isn't returning an error but it's not rendering the json either - so many things could be wrong but does anyone have an idea of where I should start looking. </p>
  
  <p>my ScoreForm.js</p>
  
  <pre><code>export default class ScoreForm extends Component {
    constructor(props) {
      super(props);
      this.state = {
        strokes: null,
        selectedCourse: null,
      };
  
    }
  
    selectCourse(){
      console.log(this.refs.courseSelector.value);
      this.setState( {selectedCourse: this.refs.courseSelector.value} );
    }
  
    enterStrokes(){
      console.log(this.refs.typeStrokes.value);
      this.setState({strokes: this.refs.typeStrokes.value});
    }
  
    handleSubmit = () =&gt; {
      const score = { strokes:this.state.strokes, user_id: this.props.currentUser, course_id: this.state.selectCourse}
      axios.put(
        `http://localhost:3001/api/v1/scores`, {score: score})
      .then(response =&gt; {
        console.log(response);
        this.props.updateScores(response.data)
      })
      .catch(error =&gt; console.log(error))
    }
  
    render() {
      var courseOptions = (this.props.courseList.map((course) =&gt; {
        return &lt;option key={course.id} value={course.id}&gt;{course.name}&lt;/option&gt; ;
      }));
      return (
        &lt;form onSubmit={this.handleSubmit}&gt;
          &lt;input ref='typeStrokes' onChange={(e) =&gt; {this.enterStrokes(); } } /&gt;
          &lt;select ref='courseSelector' onChange={(e) =&gt; { this.selectCourse(); } }&gt;{courseOptions}&lt;/select&gt;
        &lt;/form&gt;
      );
    }
  }
  </code></pre>
  
  <p>my rails routes.rb</p>
  
  <pre><code>Rails.application.routes.draw do
    namespace :api do
      namespace :v1 do
        get 'users/scores' =&gt; 'scores#index'
        get 'users/:id/scores' =&gt; 'users#scores'
        resources :users
        resources :scores
        resources :courses
      end
    end
  
  end
  </code></pre>
  
  <p>my scores_controller.rb</p>
  
  <pre><code>module Api::V1
    class ScoresController &lt; ApplicationController
      before_action :set_course
  
      def index
        @scores = Score.order("created_at DESC")
        render json: @scores
      end
  
      def create
        differential = (params[:score][:strokes].to_i) - @course.rating
  
        @score = Score.create(score_params.merge(:differential =&gt; differential))
        render json: @score
      end
  
      private
  
      def set_course
        @course = Course.find(params[:course_id])
      end
  
      def score_params
        params.require(:score).permit(:user_id, :course_id, :strokes)
      end
  
    end
  end
  </code></pre>