you sure its triggering maybe put a info log in y...
# questions
f
you sure its triggering maybe put a info log in your after method?
u
Yup, for sure it's triggered. I logged the view before and after and it was updated properly. I even had debugger breakpoints working as expected.
f
u
Not quite, those scripts will add
.gsp
files to my project which allow me to override the view content. I am asking how to override the view itself, not just the content. For example, when the
UserController#edit
action is accessed it renders the content from
/view/user/edit.gsp
I need it render the content of
/view/inertia/json.gson
. So far the only solution seems to be just re-writing the whole security-ui plugin and manually changing all render methods to use renderInertia, or instead or returning a raw model from the controller I again need to call renderInertia manually.
f
it says it lets you override the controller too
but ive never used it
was just going off of “The plugin’s controllers and GSPs are easily overridden
u
Yes, overriding the controller does work, but it's not a great solution since the only thing I actually need to change is the view, not any of the logic. I would prefer to be able to just use the existing controller instead of copy+pasting each controller+method from the plugin. The only things I end up changing in the overridden controller are the return and render statements, all the rest of the logic is identical.
f
it sounds like you need to change logic tho? — how it renders is not part of controller scope?
interested if someone knows a better way tho, will keep an eye out on this thread to see ~~ sorry not of much help
u
I'm not sure what you mean by
it sounds like you need to change logic tho? — how it renders is not part of controller scope?
How it's rendered is handled by the renderInertia trait, which is nearly identical to the standard render method on controllers. What it renders is always a controller decision
f
since the only thing I actually need to change is the view, not any of the logic <-- seems to conflict with: rendering should either be a gsp or a gson depending on the request. — on the request to me is controller domain, but i’m no pro was just reading the docs and saw that ;-).
u
gson is a json response for ajax requests, gsp is an html response for a standard browser navigation request. That's just content negotiation standard
👍 1