title: ActionController::RoutingError (No route matches [DELETE] "/tasks.1")
body: <p>I'm following a tutorial on a TODO-application using Rails 4.2.1 on my local environment.</p>
  
  <p>The problem:  <code>/task.1</code>, but it should be <code>/task/1</code>. is solve by Nithin.
  Also I edited "resource :tasks" to ":task" in config/routes.rb.</p>
  
  <p>And these solved the "edit" issue!!!</p>
  
  <p>But still get some kind of routing error on "delete". Why?</p>
  
  <p><strong>Tasks_controller</strong></p>
  
  <pre><code>class TasksController &lt; ApplicationController
    respond_to :html, :js
  
    # GET /tasks
    # GET /tasks.json
    def new
      @task = Task.new    
      render :show_form
    end
  
    # POST /task
    # POST /task.json
    def create
      @task = Task.create(task_params)
      @tasks = Task.all
    end
  
    # GET /task
    # GET /task.json
    def edit
      @task = Task.find(params[:id])
      render :show_form
    end
  
    # DELETE /task
    # DELETE /task.json
    def destory
      @task = Task.find(params[:id])
      @task.destroy
      @tasks = Task.all
    end
  
    private
  
    def task_params
      params.require(:task).permit(:title, :note, :completed)
    end
  end
  </code></pre>
  
  <p><strong>_task_list.html.erb</strong></p>
  
  <pre><code>&lt;% if @tasks.empty? %&gt;
    &lt;span class="text-warning"&gt;There are no tasks!&lt;/span&gt;
  &lt;% else %&gt;
    &lt;table class="table table-hover table-bordered"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Title&lt;/th&gt;
              &lt;th&gt;Created at&lt;/th&gt;
              &lt;th&gt;Completed&lt;/th&gt;
              &lt;th&gt;Actions&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;% @tasks.each do |task| %&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;strong&gt;&lt;%= task.title %&gt;&lt;/strong&gt;&lt;/td&gt;
                  &lt;td class="text-info"&gt;&lt;%= task.created_at %&gt;&lt;/td&gt;
                  &lt;td class="text-success"&gt;&lt;%= task.completed %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%= link_to "Delete", task_path(id: task.id), method: :delete, remote: true, data: { confirm: "Are you sure you want to delete task #{task.title}?" }, class: "btn btn-primary" %&gt;
                      &lt;%= link_to "Edit", edit_task_path(id task.id), remote: true, class: "btn btn-primary" %&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;% end %&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  
  
  <p><strong>app/views/pages/home.html.erb</strong></p>
  
  <pre><code>&lt;div id="task-list" class="container"&gt;
    &lt;%= render 'tasks/task_list', locals: {task: @task} %&gt;
  &lt;/div&gt;
  &lt;div id="modal" class="modal fade"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>destroy.js.erb</strong></p>
  
  <pre><code>$('#task-list').html('&lt;%= j(render 'task_list', locals: {task: @task} )%&gt;');
  </code></pre>
  
  <p><strong>edit.js.erb</strong></p>
  
  <pre><code>m = $('#modal');
  m.html('&lt;%= j(render 'task_form', locals: {task: @task}) %&gt;');
  m.modal('show');
  $('#modal').integrateDatepicker();
  </code></pre>
  
  <p><strong>config/routes.rb</strong></p>
  
  <pre><code>Rails.application.routes.draw do
    # Tasks
    resource :tasks, only: [:new, :create, :edit, :destory]
  
    root to: 'pages#home'
  end
  </code></pre>
  
  <p><strong>Logs: delete</strong></p>
  
  <pre><code>Started DELETE "/task?id=1" for 127.0.0.1 at 2015-04-18 12:00:33 +0700
  </code></pre>
  
  <p>ActionController::RoutingError (No route matches [DELETE] "/task"):
    actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in <code>call'
    newrelic_rpm (3.11.2.286) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in</code>call'
    web-console (2.1.2) lib/web_console/middleware.rb:37:in <code>call'
    newrelic_rpm (3.11.2.286) lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in</code>call'
    actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'</p>
  
  <pre><code>...
  </code></pre>
  
  <h2>rake routes</h2>
  
  <pre><code>    Prefix    Verb URI Pattern           Controller#Action
      tasks     POST /tasks(.:format)      tasks#create
      new_task  GET  /tasks/new(.:format)  tasks#new
      edit_task GET  /tasks/edit(.:format) tasks#edit
      root      GET  /                     pages#home
  </code></pre>