Activity
Assuming you are posting to this controller using a form, params and other variables are already there and available in turbo stream file.
Pass all saved variables to the partial and replace old one.
You should be able to pass params or variables when calling turbo
<%= turbo_stream.replace "user_#{@partial}", partial: "users/display/#{@partial}", locals: {params: params, partial: @partial } %>
This is awesome work 👏
In this example you first render the javascript and make another call to API via fetch and check the domain in API controller. Is there a specific reason for that?
Isn't it better to check the domain at embeds-controller and if domain is not registered, we will not have to render any javascript on client side.
We can get the domain by checking headers with something like URI.parse( request.env["HTTP_REFERER"])
yeap agreed! +1
.postcssrc file explained in this video causes a warning regarding the @apply rule. Warning disappears if tailwind is loaded before postcss-next