JQuery mobile not working with rails devise
<p>I am using rails 5 with <code>gem 'jquery_mobile_rails', '1.4.5'</code> and <code>gem 'jquery-turbolinks'</code> which seem to work when I remove the <code>turbolinks</code> gem. </p>

<p>my set up is as follows in application.js:</p>

<pre><code>//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require jquery.mobile
//= require_tree .
</code></pre>

<p>The problem is that when I use devise authentication my app doesn't load the navbars at the first log in instance and only shows when I refresh. I have found that if I remove the authentication bellow <code>&lt;% if user_signed_in? %&gt;</code> then the issue goes away but I need authentication?</p>

<p>_nav.html.erb:</p>

<pre><code> &lt;div data-role="navbar"&gt;
    &lt;ul&gt;
        &lt;% if user_signed_in? %&gt;
            &lt;%= link_to('Logout', destroy_user_session_path, :method =&gt; :delete) %&gt;
            &lt;%= link_to 'corners', corners_path %&gt;
            &lt;% else %&gt;
                &lt;%= link_to('Login', new_user_session_path) %&gt;&lt;/br&gt;
                Don't have an account? &lt;%= link_to('Sign Up',new_user_registration_path) %&gt;
        &lt;% end %&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>Likewise the same thing happens when I log out the page is blank but I have to reload it in order for it to work.
I have read some issues but can't see, to find the answer for this</p>