Topic: Routing Error

Good Day,

I have created a scaffold sportler and one model einheit and this:


      <%= link_to "Trainingseinheit hinzufügen", :action => "add_einheit", :id => sportler %>


  def add_einheit
    sportler = Sportler.find(params[:id])
    @einheit = => sportler)
    render :template => "einheits/edit"


Routing Error

No route matches {:action=>"add_einheit", :id=>#<Sportler id: 1, name: "Test", alter: 17, groesse: "188", created_at: "2012-12-27 12:51:22", updated_at: "2012-12-27 12:51:22">, :controller=>"sportlers"}
Try running rake routes for more information on available routes.

How can i resolve the routing problem?



FITAPP2::Application.routes.draw do
  resources :sportlers

Last edited by ubuseral (2012-12-27 09:21:16)

Re: Routing Error

The best way to analyze routing error is to - run rake routes and analyze the path available with the one you're trying to use.