Ask A Question

Notifications

You’re not receiving notifications from this thread.

Hotwire Not Working Inside of Namespace

Brian Gilbank asked in Rails

This seems like an easy fix, but I am not sure why its not working. I have an admin dashboard using Hotwire, but I can't seem to create records for my gym model (There are no errors, and it will work when I refresh). I can create records outside the namespace using the same model though, and using the same setup as below.

Do I need to pass the namespace in with the dom_id for Hotwire to work? Or is it an issue with the form_with namespace?

example namespace form
<%= form_with(model: [:dashboard, gym]) do |f| %>
 *fields
<% end %>

_gym.html.erb
<div id="<%= dom_id gym %>" class="card">
 *content
</div>

show.html.erb
<%= render @gym %>
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,400+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.