hiya!
Latest news
Found the secret sauce I think -
I’m still using primary resource
CandidateController
has_one :canbackground
In the candidate/show.rthml
I added -
<%= link_to ‘Show’, canbackground_path(@candidate, @
candidate.canbackground)
This produces the correct url , canbackgrounds/show.rhtml now shows correctly.
It was alot easier when all the partials rend
ered out of the candidates/show.rthml
I have the same or at least a similar problem:
class Car
has_one :wheel
end
map.resources wheels
map.resources
cars, :has_one => [ :wheel ]
Now if I try car_wheel_path(@car, @car.wheel) I get
undefined method `has_key?’ for #Wheel:0x48e3e20
car_wheel_path(@car) works but the url is wrong: /cars/1/wheel
and l get “Couldn’t find Wheel without an ID”
rake routes outputs:
------ POST /cars/:car_id/wheel {:controller=>“wheels”, :action=>“create”}
------ POST /cars/:car_id/wheel.:format {:controller=>“wheels”, :action=>“create”}
new_car_wheel GET /cars/:car_id/wheel/new {:controller=>“wheels”, :action=>“new”}
formatted_new_car_wheel GET /cars/:car_id/wheel/new.:format {:controller=>“wheels”, :action=>“new”}
edit_car_wheel GET /cars/:car_id/wheel/edit {:controller=>“wheels”, :action=>“edit”}
formatted_edit_car_wheel GET /cars/:car_id/wheel/edit.:format {:controller=>“wheels”, :action=>“edit”}
car_wheel GET /cars/:car_id/wheel {:controller=>“wheels”, :action=>“show”}
formatted_car_wheel GET /cars/:car_id/wheel.:format {:controller=>“wheels”, :action=>“show”}
------ PUT /cars/:car_id/wheel {:controller=>“wheels”, :action=>“update”}
------ PUT /cars/:car_id/wheel.:format {:controller=>“wheels”, :action=>“update”}
------ DELETE /cars/:car_id/wheel {:controller=>“wheels”, :action=>“destroy”}
------ DELETE /cars/:car_id/wheel.:format {:controller=>“wheels”, :action=>“destroy”}
Any ideas to solve this? How do I get the wheel_id for the wheels controller? I’m really stuck 
thanks
bye Wolfgang