diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2017-02-21 20:00:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 20:00:31 +0000 |
commit | f3d729f75363136f659f2cb78165ca5c899ecfe7 (patch) | |
tree | ad405ccb51b3982b6f342553412ac8c412d52615 /actionpack/CHANGELOG.md | |
parent | 25f5d0913dbc627ab18bd16f95a757b1d083b9e3 (diff) | |
parent | de24b8cb9c38a02b521d762d4b8eef11f6a78978 (diff) | |
download | rails-f3d729f75363136f659f2cb78165ca5c899ecfe7.tar.gz rails-f3d729f75363136f659f2cb78165ca5c899ecfe7.tar.bz2 rails-f3d729f75363136f659f2cb78165ca5c899ecfe7.zip |
Merge pull request #23138 from rails/custom-url-helpers-and-polymorphic-urls
Implement custom url helpers and polymorphic mapping
Diffstat (limited to 'actionpack/CHANGELOG.md')
-rw-r--r-- | actionpack/CHANGELOG.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 3c90a9a8fd..b47bcf3820 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,48 @@ +* Prefer `remove_method` over `undef_method` when reloading routes + + When `undef_method` is used it prevents access to other implementations of that + url helper in the ancestor chain so use `remove_method` instead to restores access. + + *Andrew White* + +* Add the `resolve` method to the routing DSL + + This new method allows customization of the polymorphic mapping of models: + + ``` ruby + resource :basket + direct(class: "Basket") { [:basket] } + ``` + + ``` erb + <%= form_for @basket do |form| %> + <!-- basket form --> + <% end %> + ``` + + This generates the correct singular URL for the form instead of the default + resources member url, e.g. `/basket` vs. `/basket/:id`. + + Fixes #1769. + + *Andrew White* + +* Add the `direct` method to the routing DSL + + This new method allows creation of custom url helpers, e.g: + + ``` ruby + direct(:apple) { "http://www.apple.com" } + + >> apple_url + => "http://www.apple.com" + ``` + + This has the advantage of being available everywhere url helpers are available + unlike custom url helpers defined in helper modules, etc. + + *Andrew White* + * Add `ActionDispatch::SystemTestCase` to Action Pack Adds Capybara integration directly into Rails through Action Pack! |