1)이 내 로그인 페이지 후 :JQuery와 모바일 네비게이션 바 활성화되지 (레일)에서 세션 로그
<% provide(:title, 'Sign In') %>
<div data-role="page" data-url="/signin/">
<h1>Sign In</h1>
<%= form_for(:session, url: sessions_path) do |f| %>
<div>
<%= f.text_field :username_or_email, placeholder: "username or email", autofocus: true %>
</div>
<div>
<%= f.password_field :password, placeholder: "password" %>
</div>
<div>
<%= f.submit "Sign In", rel: "external" %>
</div>
<% end %>
</div>
2)이 로그인 후에 나의 홈 페이지입니다 : 그러니까 기본적으로
<% provide(:title, @user.name) %>
<div data-role="page" id="home" data-url="https://stackoverflow.com/users/<%= @user.id %>/" >
<div data-role="header">
<a href="#menu">Menu</a>
<h4>Home</h4>
<%= link_to 'New', new_pin_path, rel: "external" %>
</div>
<% if [email protected]? %>
<h3>Welcome to Pins!... Enter your first pin.</h3>
<% end %>
<%= render @user.pins %>
</div>
<div data-role="page" id="menu">
<div class="ui-grid-a center">
<div class="ui-block-a menublock">
<a href="#home">Home</a>
</div>
<div class="ui-block-b menublock">
<%= link_to 'Friends Pins', pins_path %>
</div>
<div class="ui-block-a menublock">
<%= link_to 'Settings', edit_user_path(current_user) %>
</div>
<div class="ui-block-b menublock">
<%= link_to "Sign Out", signout_path, method: "delete" %>
</div>
</div>
</div>
, 로그인 한 후 <a href="#menu">Menu</a>
을 클릭하면 아무런 반응이 없습니다 (페이지를 새로 고침하지 않으면). ( http://ruby.railstutorial.org/chapters/sign-in-sign-out#top
4) 슬래시를 후행 : 나는 그것을 붙여가는 하지만, 기본적으로 내가 여기에있는 것입니다 같은 일을 매우 긴 사용되는 :
3)이 내 세션 로그인이 작동하는 방법이다 this is a requirement by jQuery Mobile) : 나는 모든 URL에 후행 슬래시가 없기 때문에 내 application.rb에 다음과 같이 추가했습니다. config.action_controller.default_url_options = { :trailing_slash => true }
페이지간에 탐색을 많이 고정했지만 문제가 해결되지는 않았습니다. 내 세션 로그인 후 문제가 발생했습니다.
5) 로그 후 홈 페이지를 새로 고칠 때 에서, 은가 올바르게 작동합니다.
이 링크에는 어떤 자바 스크립트가 사용됩니까? –
또한,'data-role = "button"'을 a_tag에 추가하고 변경 사항이 있는지 확인하십시오. –