Hi,
I have the following routes in my Rails 3 app:
resources :lists, :id => /([A-Za-z0-9]{25})|default/ do
resources :todos, :id => /\d+/
end
rake routes outputs:
list_todos GET /lists/:list_id/
todos(.:format) {:list_id=>/\d
+/, :action=>"index", :controller=>"todos"}
new_list_todo GET /lists/:list_id/todos/
new(.:format) {:list_id=>/\d
+/, :action=>"new", :controller=>"todos"}
list_todo GET /lists/:list_id/
todos/:id(.:format) {:id=>/\d+/, :list_id=>/\d
+/, :action=>"show", :controller=>"todos"}
edit_list GET /lists/:id/
edit(.:format) {:id=>/([A-Za-z0-9]{25})|
default/, :action=>"edit", :controller=>"lists"}
list GET /
lists/:id(.:format) {:id=>/([A-Za-z0-9]{25})|
default/, :action=>"show", :controller=>"lists"}
:list_id for the nested resource simply can''t be right?
I tracked it down to nested_options in mapper.rb
options[:constraints] = { "#{parent_resource.singular}
_id".to_sym => id_constraint } if id_constraint?
In my eyes this doesn''t make sense. Is there a way to get the
id_constraint of the parent_resource?
Cheers,
Martin
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.