-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Redirect] Allows for Class and Symbol Controller name (#363)
* [REDIRECT] Allows for Class and Symbol Full Controller name Issue: #353 > As a developer I would like to pass and full controller name to a redirect as a class or symbol and allow for the redirection to happen Example `redirect_to controller: :HomeController, action: :index` - Would be nice to accept HelloController::Index or Admin::UserController:Index * fixup! [REDIRECT] Allows for Class and Symbol Full Controller name * Adds Hash Table Lookup for Routes Looking up routes base on controller and action in a radix tree causes On2 many cases because of the radix tree. To avoid that pain this adds hash table to perform lookups by conntroller name and action while this might consume more memory it performs better and makes the code cleaner and lookups based on controller#action are now more reliable Signed-off-by: Elias Perez <eliasjpr@gmail.com> * Removes Redirect Exception Since it is now using hash table lookup for redirects there is no need for raising errors, if the controller action combination does not exists it throws KeyError exception. Signed-off-by: Elias Perez <eliasjpr@gmail.com> * Cleanup and fixes specs Signed-off-by: Elias Perez <eliasjpr@gmail.com> * Cleanup
- Loading branch information
Showing
9 changed files
with
131 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.