Update forms from 2 different locations

I have a model that has to be updated from the admin and user (to separate form locations).

I was wondering if I can pass a variable with the user form and flash a message and keep them on the same page.

Thanks, Joe

You’ll want to check this in your controller so that the user can’t manipulate this. What do you mean by keep them on the same page? Do you just want to share a form?

I’ve got a regular form for the admin to add questions to the model.

But for the user, I have an index (of forms) that they can check off and place a comment. So, I don’t want them to navigate away from that page, I would just like to flash a notice message that that record has been updated.

Ah, you’re looking for a Turbo/Hotwire/Stimulus combination or just some JS to handle a form submission. https://hotwired.dev/

we’re not using rails 7.0, we are using ‘rails’, ‘4.2.5.2’…

so, I’m just hoping to reload the same page with a flash notice.

You could use remote: true for the form, here’s a few uses Rails way of AJAX with remote: true | by Tushar Adhao | Medium

Or just write some JS to handle the form submission and take you back to that page with.

Thanks, I’ll have to split this table up anyways. So, I might run into another issue before that.