title: Rails Routing Error :action => 'new' returns error “No route matches {:action=>”show" in the controller
body: <p>Model "Project" was generated by scaffolding.</p>
  
  <p>config/routes.rb contains the line resources :projects. </p>
  
  <p>I have a link from the index view to new_project_path.</p>
  
  <p>Problem is with the link to /new. The url application/project/new has the following error:</p>
  
  <p>No route matches {:action=>"show", :controller=>"projects"}</p>
  
  <p>It was working but now isn't working, i don't know why. Any ideas?</p>
  
  <pre><code>class ProjectsController &lt; ApplicationController
    # GET /projects
    # GET /projects.json
    def index
      @projects = Project.paginate(:page=&gt;params[:page],:per_page=&gt;15)
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @projects }
      end
    end
  
    # GET /projects/1
    # GET /projects/1.json
    def show
      @project = Project.find(params[:id])
      @tasks=@project.tasks.paginate(:page=&gt;params[:page],:per_page=&gt;15)
  
      respond_to do |format|
        format.html # show.html.erb
        format.json { render json: @project }
      end
    end
  
    # GET /projects/new
    # GET /projects/new.json
    def new
      @project = Project.new
  
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @project }
      end
    end
  
    # GET /projects/1/edit
    def edit
      @project = Project.find(params[:id])
    end
  
    # POST /projects
    # POST /projects.json
    def create
      @project = Project.new(params[:project])
  
      respond_to do |format|
        if @project.save
          format.html { redirect_to projects_path, notice: 'Project was successfully created.' }
          format.json { render json: @project, status: :created, location: @project }
        else
          format.html { render action: "new" }
          format.json { render json: @project.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PUT /projects/1
    # PUT /projects/1.json
    def update
      @project = Project.find(params[:id])
  
      respond_to do |format|
        if @project.update_attributes(params[:project])
          format.html { redirect_to @project, notice: 'Project was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit" }
          format.json { render json: @project.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # DELETE /projects/1
    # DELETE /projects/1.json
    def destroy
      @project = Project.find(params[:id])
      @project.destroy
  
      respond_to do |format|
        format.html { redirect_to projects_url }
        format.json { head :no_content }
      end
    end
  
    def sort_tasks
      project = Project.find(params[:id])
      tasks = project.tasks
      tasks.each do |task|
        task.position = params['task'].index(task.id.to_s) + 1
        task.save
      end
      render :nothing =&gt; true
    end
  
  end
  </code></pre>
  
  <p>routes.rb:</p>
  
  <pre><code>Taska::Application.routes.draw do
    resources :projects
    resources :tasks
  
    root :to =&gt; 'projects#index'
  
    match ':controller(/:action(/:id))(.:format)'
  end
  </code></pre>
  
  <p>_form.html.erb:</p>
  
  <pre><code>&lt;%= form_for @project, :html =&gt; { :class =&gt; 'form-horizontal' } do |f| %&gt;
    &lt;div class="control-group"&gt;
      &lt;%= f.label :title, :class =&gt; 'control-label' %&gt;
      &lt;div class="controls"&gt;
        &lt;%= f.text_field :title, :class =&gt; 'text_field' %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="control-group"&gt;
      &lt;%= f.label :description, :class =&gt; 'control-label' %&gt;
      &lt;div class="controls"&gt;
        &lt;%= f.text_area :description, :class =&gt; 'text_area', rows: 5 %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="form-actions"&gt;
      &lt;%= f.submit nil, :class =&gt; 'btn btn-primary' %&gt;
      &lt;%= link_to t('.cancel', :default =&gt; t("helpers.links.cancel")),
                  project_path(@project), :class =&gt; 'btn' %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>index.htm.erb:</p>
  
  <pre><code>&lt;%- model_class = Project -%&gt;
  &lt;div class="page-header"&gt;
    &lt;h3&gt;&lt;%=t '.title', :default =&gt; model_class.model_name.human.pluralize %&gt;&lt;/h3&gt;
    &lt;%= link_to t('.new', :default =&gt; t("helpers.links.new")),
                new_project_path,
                :class =&gt; 'btn btn-primary' %&gt;
  &lt;/div&gt;
  
  &lt;table class="table table-striped"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;%= model_class.human_attribute_name(:title) %&gt;&lt;/th&gt;
        &lt;th&gt;Tasks count&lt;/th&gt;
        &lt;th&gt;Updated at&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
  
      &lt;% @projects.each do |project| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= link_to project.title, project_path(project) %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= project.tasks.size %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= project.updated_at %&gt;&lt;/td&gt;
        &lt;/tr&gt;
  
      &lt;% end %&gt;
  
    &lt;/tbody&gt; 
  
  &lt;/table&gt;
  &lt;%= will_paginate @projects %&gt;
  </code></pre>
  
  <p>show.html.erb:</p>
  
  <pre><code>&lt;%- model_class = Project -%&gt;
  &lt;div class="page-header"&gt;
    &lt;h1&gt;&lt;%=t '.title', :default =&gt; @project.title %&gt;&lt;/h1&gt;
    &lt;h4&gt;&lt;%= @project.description %&gt;&lt;/h4&gt;
    &lt;%= link_to t('.edit', :default =&gt; t("helpers.links.edit")),
                        edit_project_path(@project), :class =&gt; 'btn btn-primary' %&gt;
            &lt;%= link_to t('.destroy', :default =&gt; t("helpers.links.destroy")),
                        project_path(@project),
                        :method =&gt; :delete,
                        :data =&gt; { :confirm =&gt; t('.confirm', :default =&gt; t("helpers.links.confirm", :default =&gt; 'Are you sure?')) },
                        :class =&gt; 'btn btn-primary btn-danger' %&gt;
  
  &lt;h2&gt;Tasks:&lt;/h2&gt;
  
  &lt;%= link_to t('.new', :default =&gt; t("helpers.links.new")),
              new_task_path(:project_id =&gt; @project),
              :class =&gt; 'btn btn-primary' %&gt;
  &lt;/div&gt;
  
  &lt;table class="table table-striped"&gt;
    &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;/td&gt;
      &lt;th&gt;&lt;%= model_class.human_attribute_name(:type) %&gt;&lt;/th&gt;
      &lt;th&gt;&lt;%= model_class.human_attribute_name(:title) %&gt;&lt;/th&gt;
      &lt;th&gt;&lt;%= model_class.human_attribute_name(:status) %&gt;&lt;/th&gt;
      &lt;th&gt;&lt;%= model_class.human_attribute_name(:updated_at) %&gt;&lt;/th&gt;
    &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody id="tasks_list"&gt;
    &lt;% @tasks.each do |task| %&gt;
        &lt;tr id="task_&lt;%= task.id %&gt;" class="handle" &gt;
          &lt;td&gt;&lt;%= link_to "open task",task_path(task) %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= task.type.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= task.title %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= task.status.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= task.updated_at %&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;%= will_paginate @tasks %&gt;
  &lt;input type="hidden" id="project_id" value='&lt;%=@project.id%&gt;'&gt;
  </code></pre>
  
  <p>new.html.erb : </p>
  
  <pre><code>&lt;%- model_class = Project -%&gt;
  &lt;div class="page-header"&gt;
    &lt;h1&gt;New project&lt;/h1&gt;
  &lt;/div&gt;
  &lt;%= render :partial =&gt; 'form' %&gt;
  </code></pre>