i have created project scaffold and stage scaffold.i have a rendered a button on show page of the project to that open a form of stages. but i am getting no method error. i want to pass project_id to stage created. i have one to many association between project and stage. error
projects_controller.rb
  def index
    @projects = current_user.projects.all.paginate(page: params[:page], per_page: 15)
  end
  def show
    @project=Project.find(params[:id])
    @stages = Stage.all
  end
stages_controller.rb
  def index
    @stages = Stage.all
  end
  def show
  end
  def new
    @stages = Stage.new
    @project = Project.find(params[:project_id])
  end
  def create
    @project = Project.find(params[:project_id])
    @stage = @project.stages.build(stages_params)
    respond_to do |format|
      if @stage.save
        format.html { redirect_to @stage, notice: 'Stage was successfully created.' }
        format.json { render :show, status: :created, location: @stage }
      else
        format.html { render :new }
        format.json { render json: @stage.errors, status: :unprocessable_entity }
      end
    end
routes.rb
  resources :projects do
    resources :stages
  end
model project.rb
has_many :stages
rake routes
             Prefix Verb   URI Pattern                                                                              Controller#Action
                    tasks GET    /tasks(.:format)                                                                         tasks#index
                          POST   /tasks(.:format)                                                                         tasks#create
                 new_task GET    /tasks/new(.:format)                                                                     tasks#new
                edit_task GET    /tasks/:id/edit(.:format)                                                                tasks#edit
                     task GET    /tasks/:id(.:format)                                                                     tasks#show
                          PATCH  /tasks/:id(.:format)                                                                     tasks#update
                          PUT    /tasks/:id(.:format)                                                                     tasks#update
                          DELETE /tasks/:id(.:format)                                                                     tasks#destroy
           project_stages GET    /projects/:project_id/stages(.:format)                                                   stages#index
                          POST   /projects/:project_id/stages(.:format)                                                   stages#create
        new_project_stage GET    /projects/:project_id/stages/new(.:format)                                               stages#new
       edit_project_stage GET    /projects/:project_id/stages/:id/edit(.:format)                                          stages#edit
            project_stage GET    /projects/:project_id/stages/:id(.:format)                                               stages#show
                          PATCH  /projects/:project_id/stages/:id(.:format)                                               stages#update
                          PUT    /projects/:project_id/stages/:id(.:format)                                               stages#update
                          DELETE /projects/:project_id/stages/:id(.:format)                                               stages#destroy
                 projects GET    /projects(.:format)                                                                      projects#index
                          POST   /projects(.:format)                                                                      projects#create
              new_project GET    /projects/new(.:format)                                                                  projects#new
             edit_project GET    /projects/:id/edit(.:format)                                                             projects#edit
                  project GET    /projects/:id(.:format)                                                                  projects#show
                          PATCH  /projects/:id(.:format)                                                                  projects#update
                          PUT    /projects/:id(.:format)                                                                  projects#update
                          DELETE /projects/:id(.:format)                                                                  projects#destroy
project show.html.erb
<%= link_to "Add Stage", new_project_stage_url(@project), :class=>"button primary small" %>
 
     
    