Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Its now possible to use match 'stuff' => 'what#stuff' instead of usin…
…g the :to for simple routes
- Loading branch information
Showing
2 changed files
with
20 additions
and
6 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
3 comments
on commit 3ff9e9e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction: args.first.shift or args.first.first :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My feeling is that the following should not behave differently, but they currently do:
root 'store#index', :as => 'store'
match '/' => 'store#index', :as => 'store'
match '/', :to => 'store#index', :as => 'store'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
The args.first thingy is ugly (line marked). You could just use:
path, to = args.shift
options = { :to => to }