Pass url on each request and parse to build params hash#69
Conversation
|
So I ran into issues testing this pull request locally. In an Apparently the current This is supported by the fact that commenting out fixes the problem. I think we need a test case covering this scenario and solve it. I'll try to think about how to tackle that. |
|
Follow up: tried |
|
A chat in Discord yielded some new ideas. https://discord.com/channels/629472241427415060/683317130598285363/770177899927044106 I'll attempt to write a failing test and fix in the next few days. |
|
hey @rickychilcott just so you know - I've picked this up again and try to produce a failing test! I'll keep you posted here. |
|
Thanks Julian. With the new kid in the house and being back to work, I've not been able to find time to pick this back up. If you don't have something by the end of the week, I can put some cycles in during a lazy day from the holidays. |
|
Nevermind. I think I’m 50% there. Once we have a failing test it’ll be easier to find a solution. |
|
so, just to record my progress, I'm one step further towards understanding what is actually going on: the problem occurs when the rendered partial contains another partial that uses an association. in my case the futurized partial is a |
|
alright I pushed the fix to your PR here... seemingly I'll still try to create a test case for this... |
|
That. Is. Weird. Good find. |
|
Still struggling to grok what is actually happening and why :-/ |
|
Progress: I've tracked this down to this line: where And: the problem obviously lies within route generation, so it's only occurring when there's some path helper involved |
1353380 to
daf9d8a
Compare
daf9d8a to
87d84d2
Compare
|
It seems like I finally do have a fix... thanks @RolandStuder for all the help! Seemingly the @rickychilcott could you do another quick pass of eyes on this before I merge it? Thanks! |
|
I tested this locally with my little test harness, in addition to the test suite, and this fix seems to be good. Thanks for your continued work on this @julianrubisch and for the assistance @RolandStuder! |
Enhancement
Description
This PR sends the current url (
window.location.href) down the wire on each request. This URL is then parsed and the context for the query parameters is passed to the appropriate controller. Specifically, this will allowparamsto be used inside of helper methods or view templates properlyFixes #54
Note: this changes up the test suite for channel tests quite a bit and restructures how and where controllers and their renders are resolved. This is to primarily simplify the object's roles and to make testing much easier.
Checklist