title: Rails ActiveRecord Ignoring Params and Saving Nil Data
body: <p>This is stumping me; For some reason the db is saving the record with nil fields instead of my params.  Can anyone help me understand why ActiveRecord isn't using my params?</p>
  
  <p>db migration:</p>
  
  <pre><code>class CreateRoutes &lt; ActiveRecord::Migration
    def change
      create_table :routes do |t|
        t.integer :user_id
        t.string  :start_address
        t.string  :end_address
        t.text    :waypoints
        t.text    :schedule
        t.integer :duration
  
        t.timestamps
      end
      add_index :routes, :user_id
    end
  end
  </code></pre>
  
  <p>route.rb:</p>
  
  <pre><code>class Route &lt; ActiveRecord::Base
    attr_accessor :start_address, :end_address, :waypoints, :schedule, :duration
    belongs_to :user
    #serialize :waypoints, :schedule
  
    validates :user_id, presence: true
    validates :start_address, presence: true
    validates :end_address, presence: true
    validates :schedule, presence: true
    validates :duration, presence: true, numericality: { only_integer: true, greater_than: 0 }
  
  end
  </code></pre>
  
  <p>routes_controller.rb:</p>
  
  <pre><code>class RoutesController &lt; ApplicationController
    .
    .
    .
    def create
      logger.debug "\n\n*** #{params[:route]} ***"
  
      @route = current_user.routes.build(params[:route])
  
      logger.debug "*** The route is #{@route.inspect} ***\n\n"
  
      if @route.save
        flash[:success] = "Route saved!"
        redirect_to user_path(current_user)
      else
        render 'new'
      end
    end
    .
    .
    .
  end
  </code></pre>
  
  <p>logger output:</p>
  
  <pre><code>*** {"start_address"=&gt;"123 Sample St.", "end_address"=&gt;"321 Elpmas St.", "waypoints"=&gt;"None", "schedule"=&gt;"Mondays", "duration"=&gt;"15"} ***
  *** The route is #&lt;Route id: nil, user_id: 1, start_address: nil, end_address: nil, waypoints: nil, schedule: nil, duration: nil, created_at: nil, updated_at: nil&gt; ***
  </code></pre>