title: Rails: No route matches ... missing required keys: [:id]
body: <p>Full error:</p>
  
  <pre><code>No route matches {:id=&gt;#&lt;Reminder id: nil, medication: nil, time: nil, created_at: nil, updated_at: nil, user_id: 1&gt;} missing required keys: [:id]
  </code></pre>
  
  <p>Here is the code from index.html.erb that is causing the error:</p>
  
  <pre><code>&lt;tbody&gt;
      &lt;% @reminders.each do |reminder| %&gt;
        &lt;tr &lt;%= dom_id(reminder) %&gt;&gt;
          &lt;td&gt;&lt;%= reminder.medication %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= reminder.time %&gt;&lt;/td&gt;
          &lt;td&gt;
            &lt;%= link_to "Edit", edit_reminder_path(reminder) %&gt;
            or
            &lt;%= link_to 'Remove', reminder, method: :delete, data: { confirm: 'Are you sure?' } %&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  </code></pre>
  
  <p>Models:</p>
  
  <pre><code>class Reminder &lt; ActiveRecord::Base
      validates :medication, presence: true
      belongs_to :user
  end
  class User &lt; ActiveRecord::Base
    has_many :reminders
  end
  </code></pre>
  
  <p>Actions:</p>
  
  <pre><code>  def index
      @reminders = current_user.reminders
      @reminder = current_user.reminders.new 
    end
    def edit
    end
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>Medy::Application.routes.draw do
    devise_for :users
    resources :reminders
    root 'reminders#index'
  end
  </code></pre>
  
  <p>Do I need to add something to the edit action to make this work?</p>
  
  <p>The error started happening after I changed <code>@reminders = Reminders.all</code> to <code>@reminders = current_user.reminders</code> in the index action.</p>