I am using friendly url.
I am using that problem when I visit http://localhost:3000/9 it shows the same page as http://localhost:3000/vind-rejse
My Category vind-rejse have the ID of 9
How do I get rails only to respond on http://localhost:3000/vind-rejse?
And how do I link to konkurrancers show action?
My Kategoris controller:
def show
@kategori = Kategori.find(params[:id])
@konkurrancer = @kategori.konkurrancers.find(:all)
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @kategori }
end
end
My Konkurrancers controller:
def show
@konkurrancer = Konkurrancer.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @konkurrancer }
end
end
My routes:
match ':kategoris/:id' => 'konkurrancers#show'
match '/:id' => 'kategoris#show'
def to_param #... end
? – errorhandler