Nested rest

If I might have a newbie question:

I’m trying to make a restful app with nested URL-s, like:


My problem is, that now the named paths are not working in my rhtml

<% for work_time in @work_times %>

<%=link_to 'Show', work_time_path(work_time) %>

–> generates an error:

work_time_url failed to generate from
{:worker_id=>“1”, :controller=>“work_times”, :action=>“show”},
expected: {:controller=>“work_times”, :action=>“show”}, diff:

I understand, that the :id => should be the first thing
in the hash, and thats what should happen with
“work_time_path(work_time)”. But the :worker_id gets there. Could
someone help me out why this is happening?

Thx a lot!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs