Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [8fb9df535e9fcf4c117ffd3254027e0fe2425cb7] by Piotr Sarnacki

Revision 8fb9df535e9fcf4c117ffd3254027e0fe2425cb7, committed by Piotr Sarnacki · September 3rd, 2010 @ 09:59 PM

Modified polymorphic_url to check for model's namespace

This change allows using namespaced models with polymorphic_url,
in the way that you would use them without namespace.

Let's say that you have Blog::Post model in namespaced Engine. When you use
polymorphic_path with Blog::Post instances, like in form_for(@post),
it will look for blog_posts_path named url helper. As we are inside Blog::Engine,
it's annoying to always use the prefix. With this commit, blog_ prefix will be
removed and posts_path will be called.
http://github.com/rails/rails/commit/8fb9df535e9fcf4c117ffd3254027e...

2 changed files

  • M actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
  • M railties/test/railties/engine_test.rb