Ability to propogate :params values to #match blocks
Reported by Star Trader | May 14th, 2008 @ 11:26 PM | in 0.9.4
While ticket 323 makes the documentation match the current behavior, there still ought to be some way of propagating params values to child behaviors in match. This will require a change in a public method and might want to be done in conjunction with ticket 321.
I suggest that :controller and :action be specially recognized and pulled out of the conditions hash if present and placed in the params hash. These values should never be valid keys for conditions. I also suggest that the :params key be pulled out and merged with the @params value then passed into the new behavior yielded to the block. This would cause the least disruption in public API.
If I receive positive feedback, I will work on and submit a patch.
Comments and changes to this ticket
-
Michael Klishin (antares) May 15th, 2008 @ 12:28 AM
- → State changed from new to open
- → Milestone changed from to 0.9.4
It would be useful and yes, I think we can just treat controller and action keys as "special".
But because router is important part of the API and we are close to 1.0, please ask in Merb google group.
-
Star Trader May 16th, 2008 @ 01:09 PM
The following patches add the described functionality. They include 5 spec behaviors to verify that everything is working as advertised, and the documentation has been changed to reflect the new functionality. It applied cleanly to the github master branch when created.
All Tests Pass
RDoc Generated successfully with clean formatting
Please excuse the terse commit messages, I'm still learning what git hangs on to for posterity.
-
Michael D. Ivey (ivey) May 16th, 2008 @ 02:12 PM
- → Title changed from Ability to propigate :params values to #match blocks to Ability to propogate :params values to #match blocks
-
Michael Klishin (antares) May 16th, 2008 @ 06:33 PM
- → Assigned user changed from to Michael Klishin (antares)
- → State changed from open to resolved
Applied and pushed, thank you.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
