You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to get Inertia modal to work with the base URL enhancement (updating the URL and using browser history), but I haven't had any luck.
I'm encountering an error where the base page, which is attempted to be rendered, doesn't receive the correct parameters it requires, despite the parameters being part of the base URL (it's a path parameter).
For example:
I have a base route where the modal link is: /posts/:id. This base URL is correctly being passed to the render_base_url method, but it causes an error when attempting to render show method for /posts/:id. This is because when accessing the id via params.require(:id), the params object has no id.
I believe the bug might be within render_base_url and that it isn't correctly getting the parameters required for the base URL request, as it seems to use @request, which I suspect is for the modal request. I haven't spent much time on this at all, so I could be entirely wrong about the root cause.
On a side note, I have successfully got the modal working without the inertia_modal render.
I haven't spent long trying to debug this, so I thought it would be better to open a discussion rather than an issue.
Thanks in advance for any time taken towards this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been trying to get Inertia modal to work with the base URL enhancement (updating the URL and using browser history), but I haven't had any luck.
I'm encountering an error where the base page, which is attempted to be rendered, doesn't receive the correct parameters it requires, despite the parameters being part of the base URL (it's a path parameter).
For example:
I have a base route where the modal link is:
/posts/:id
. This base URL is correctly being passed to therender_base_url
method, but it causes an error when attempting to rendershow
method for/posts/:id
. This is because when accessing theid
viaparams.require(:id
), the params object has no id.I believe the bug might be within
render_base_url
and that it isn't correctly getting the parameters required for the base URL request, as it seems to use@request
, which I suspect is for the modal request. I haven't spent much time on this at all, so I could be entirely wrong about the root cause.On a side note, I have successfully got the modal working without the inertia_modal render.
I haven't spent long trying to debug this, so I thought it would be better to open a discussion rather than an issue.
Thanks in advance for any time taken towards this.
Beta Was this translation helpful? Give feedback.
All reactions