My Rails 5.2, Devise 4.7 app has the standard single sign_in page for new devise sessions.
I want the user to be able to browse a few different pages before signing in, and for each page to have the sign in form on it.
How can I display the devise form for new sessions in the views of other controller actions? Is there a way to run the code from the Devise::SessionsController#new
action, from my other controllers? Or do I need to keep a single signin page for new sessions and then add custom things to the page via separate ajax actions?
I put an empty <div id="preview_here"</div>
in app/views/devise/sessions/new.html.erb and it gets populated from ajax calls (to non-Devise controllers with skip_before_action :authenticate_user!
)