여기에서 Michael Hartl의 유명한 Ruby on Rails 튜토리얼 (Rails 3.2)을 따르고 있습니다. "11.2.5 Ajax를 사용하는 작업 버튼"섹션은 로컬 시스템에서 작동하지만 Heroku에서는 작동하지 않습니다. 팔로우 또는 언 폴트 버튼을 클릭하면 페이지의 아무 것도 새로 고침되지 않습니다. 비록 내가 볼 수 있지만 작업은 실제로 로그에서 호출되었습니다. AJAX를 사용하는 버튼이 Heroku에서 작동하지 않습니다.
2012-02-22T04:05:17+00:00 app[web.1]: Started POST "/relationships" for 67.188.133.121 at 2012-02-22 04:05:17 +0000
2012-02-22T04:05:17+00:00 app[web.1]: Processing by RelationshipsController#create as JS
2012-02-22T04:05:17+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"nsYrHM0aLlEGoI19Zv8hImEmbfWPZ+gSy5xmgAV+V60=", "relationship"=>{"followed_id"=>"15"}, "commit"=>"Follow"}
2012-02-22T04:05:17+00:00 app[web.1]: Redirected to https://etl-rails32-tut-sample-app.herokuapp.com/users/15
2012-02-22T04:05:17+00:00 app[web.1]: cache: [POST /relationships] invalidate, pass
2012-02-22T04:05:17+00:00 app[web.1]: Completed 302 Found in 66ms (ActiveRecord: 61.2ms)
2012-02-22T04:05:17+00:00 heroku[router]: POST etl-rails32-tut-sample-app.herokuapp.com/relationships dyno=web.1 queue=0 wait=0ms service=75ms status=302 bytes=123
은 그럼 수동으로 전체 페이지를 새로 고침 브라우저의 새로 고침 버튼 (파이어 폭스 7.0)을 클릭했고, 버튼이 제대로 결과에 전환 할 것입니다.
파일, 응용 프로그램/뷰/레이아웃/application.html.erb은 다음과 같습니다 :
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= render 'layouts/stylesheets' %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<div class="container">
<%= render 'layouts/header' %>
<section class="round">
<% flash.each do |key, value| %>
<%= content_tag(:div, value, class: "flash #{key}") %>
<% end %>
<%= yield %>
</section>
<%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
</div>
</body>
</html>