0

私は比較的単純な Rails 4 アプリケーション (nitrous.io で実行) を持っていますが、これは独特のことをしています。GET リクエストを介して読み込まれるフォームがあり、フォーム ページが読み込まれると、Rails サーバーは HTML のみをレンダリングし、アセットはレンダリングしません。

Started GET "/posts/new" for 198.84.233.70 at 2013-07-19 06:40:16 +0000                                                                                                 
Processing by PostsController#new as HTML                                                                                                                               
  Rendered posts/_comments_form.html.erb (4.1ms)                                                                                                                         
  Rendered posts/new.html.erb within layouts/application (22.5ms)                                                                                                       
Completed 200 OK in 39ms (Views: 36.6ms | ActiveRecord: 0.0ms)   

その結果、私の jQuery バインディングはどれも実行されません (実際には、JavaScript はまったくありません)。そのため、ページが正しく機能しません。

ページをリロードすると (ブラウザーの [更新] ボタンをクリックして)、すべてのアセットが提供され、すべての JavaScript が実行され、すべて正常に動作します。

Completed 200 OK in 62ms (Views: 60.7ms | ActiveRecord: 0.0ms)                                                                                                          


Started GET "/posts/new" for 198.84.233.70 at 2013-07-19 06:40:27 +0000                                                                                                 
Processing by PostsController#new as HTML                                                                                                                               
  Rendered posts/_comments_form.html.erb (2.5ms)                                                                                                                         
  Rendered posts/new.html.erb within layouts/application (49.5ms)                                                                                                       
Completed 200 OK in 62ms (Views: 60.7ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.css?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000                                                                             
Started GET "/assets/bootstrap_and_overrides.css?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000                                                                 
Started GET "/assets/wines.css?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000
Started GET "/assets/jquery.js?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000                                                                                   
Started GET "/assets/jquery_ujs.js?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000                                                                               
Started GET "/assets/twitter/bootstrap/bootstrap-transition.js?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000
Started GET "/assets/posts.js?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000                                                                                    
Started GET "/assets/application.js?body=1" for 198.84.233.70 at 2013-07-19 06:40:29 +0000
4

1 に答える 1

0

上のコメントより

Rails 4 では、Turbolinks がデフォルトで含まれているため、page:change.

于 2013-07-19T14:43:09.813 に答える