How would I move the built in Devise edit_user_registration view to a modal so as when a use clicks on the settings link on a page a modal is shown instead of Rails routing to the view. I’m using bootstrap and wishing to use their code, but I’m unsure as to where one actually places the contents of your modal view in rails?
Will I have to override the devise path or even the controller?
Calling a modal is done via in any layout right… so
<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>
My initial thought was wrap my ..devise/registration/edit.html.erb with the appropriate Modal elements and id but I’m not sure if putting href= “#myModal” must be the same as the id of the modal or can i use the default devise edit route…
Im if i didn’t use devise I wouldn’t have a problem.
Bootstrap performs some JS magic so that the href in your anchor tag href=”#myModal” picks up a div with the same id and uses it to display as the contents as the modal.
What you want to do is this
This will render the devise view in your current view but it will be hidden thanks to bootstrap. Then thanks to bootstrap when someone clicks the Launch Modal button it will show the hidden contents: your user edit form.