I need that, after clicking a button, a modal appears, within that modal there is a populated form (or not) with rails objects. The problem is that I can not change the accept header to js so that rails render (not printe the code on the screen but rather execute) a .js.erb. To resolve this, I decided to put a data-remote=true
in the button so that .js.erb was executed but the page was not reloaded, however I need to change the url and so I wanted to use wiselinks with the data-push=true
attribute, but the two together does not work. Can someone help me with the modal problem or can you help me with how I do the modal appear with the remote and change the url with pushState ???
PS. the ideal would be that when clicking the button the modal appeared (with the content under the previous action) and when accessing the url directly the modal was also rendered (with a content of another action underneath)