rails/rails — pull request #7580 by spohlenz (2012-09-09 07:08:49+00:00)
Title: Use internal instance variable naming scheme for mounted URL helpers

Using the canonical blog example, given an isolated/mounted engine within a module `Blog`, the current behaviour of the mounted URL helpers is to create a method `blog` which sets an instance variable `@blog`.

This effectively prevents the instance variable `@blog` from being usable anywhere else within the application where we also want to refer to the blog engine's routes. For example the home page controller action will raise an error if we assign the `@blog` ivar and then try to refer to `blog.post_path(@blog)`.

The straight-forward fix for this is to name the instance variable for the mounted helpers using internal naming conventions, in this case `@_blog`.