title: No route matches - missing required keys: [id] ?
body: <p>I'm doing a Rails tutorial, and trying to figure out why this is happening.</p>
  
  <p>I'm making a to-do list, and everytime I try and insert a record into my Todo model, I get the following: </p>
  
  <p><img src="https://i.stack.imgur.com/Refsh.png" alt="error!"></p>
  
  <p>Here is the <code>new.html.erb</code> view that this is from:</p>
  
  <pre><code>&lt;h1&gt;Add new item to your todo listM&lt;/h1&gt;
  &lt;%= form_for @todo, :url=&gt;todo_path(@todo) do |f| %&gt;
      &lt;%= f.label :name %&gt; &lt;%= f.text_field :name%&gt;
      &lt;%= f.hidden_field :done, :value =&gt; false %&gt;
      &lt;%= f.submit "Add to todo list" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Here is <code>index.html.erb</code> from where the user is linked to <code>new.html.erb</code></p>
  
  <pre><code>&lt;h1&gt;TASKS&lt;/h1&gt;
  
  &lt;h3&gt; TO DO &lt;/h3&gt;
  &lt;ul&gt;
  &lt;% @todos.each do |t| %&gt;
      &lt;li&gt;
          &lt;strong&gt;&lt;%= t.name %&gt;&lt;/strong&gt;
          &lt;small&gt;&lt;%= link_to "Mark as Done", todo_path(t), :method =&gt; :put %&gt;&lt;/small&gt;
      &lt;/li&gt;
  &lt;% end %&gt;
  &lt;/ul&gt;
  
  &lt;h3&gt; DONE &lt;/h3&gt;
  &lt;ul&gt;
  &lt;% @todones.each do |t| %&gt;
      &lt;li&gt;
          &lt;strong&gt;&lt;%= t.name %&gt;&lt;/strong&gt;
          &lt;small&gt;&lt;%= link_to "Remove", t, :confirm =&gt; "You sure?", :method =&gt; :delete %&gt;&lt;/small&gt;
      &lt;/li&gt;
  &lt;% end %&gt;
  &lt;/ul&gt;
  
  &lt;%= link_to "Add new task", new_todo_path %&gt;
  </code></pre>
  
  <p>Here is the <code>TodoController</code> I have managing these actions:</p>
  
  <pre><code>class TodoController &lt; ApplicationController
  
      def index
          @todos = Todo.where(done:false)
          @todones = Todo.where(done:true)
      end
  
      def new
          @todo = Todo.new
      end
  
      def todo_params
          params.require(:todo).permit(:name, :done)
      end
  
      def create
          @todo = Todo.new(todo_params)
          if @todo.save
              redirect_to todo_index_path, :notice =&gt; "Your todo item was created!"
          else
              render "new"
          end
      end
  
      def update
          @todo = Todo.find(params[:id])
  
          if @todo.update_attribute(:done, true)
              redirect_to todo_index_path, :notice =&gt; "Your todo item was marked done!"
          else
              redirect_to todo_index_path, :notice =&gt; "Couldn't update your task"
          end
      end
  
      def destroy
          @todo = Todo.find(params[:id])
          @todo.destroy
  
          redirect_to todo_index_path, :notice =&gt; "Your todo item was deleted"
      end
  
  end
  </code></pre>
  
  <p>And finally the <code>routes.rb</code></p>
  
  <pre><code>Oneday::Application.routes.draw do
    devise_for :users
    root 'home#index'
    resources :todo
  end
  </code></pre>
  
  <p>Any input as to why this is happening and how to rectify it would be great.</p>